Merge lp:~jelmer/brz/launchpad-nested into lp:brz/3.3

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: 7794
Merged at revision: 7795
Proposed branch: lp:~jelmer/brz/launchpad-nested
Merge into: lp:brz/3.3
Diff against target: 33 lines (+11/-4)
1 file modified
breezy/plugins/launchpad/lp_directory.py (+11/-4)
To merge this branch: bzr merge lp:~jelmer/brz/launchpad-nested
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+440171@code.launchpad.net

Commit message

Fix handling of subpaths in lp: URLs

Description of the change

Fix handling of subpaths in lp: URLs

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks Jelmer, that's going to be make easier some of our work on Lunar!

Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :
Download full text (106.7 KiB)

The attempt to merge lp:~jelmer/brz/launchpad-nested into lp:brz/3.3 failed. Command exited with 1.
Below is the output from the failed tests.

Collecting setuptools-gettext
  Downloading setuptools_gettext-0.1.3-py3-none-any.whl (10 kB)
Requirement already satisfied: setuptools>=46.1 in ./lib/python3.11/site-packages (from setuptools-gettext) (66.1.1)
Installing collected packages: setuptools-gettext
Successfully installed setuptools-gettext-0.1.3
Obtaining file:///tmp/tarmac/branch.wk5knryk
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Checking if build backend supports build_editable: started
  Checking if build backend supports build_editable: finished with status 'done'
  Getting requirements to build editable: started
  Getting requirements to build editable: finished with status 'done'
  Installing backend dependencies: started
  Installing backend dependencies: finished with status 'done'
  Preparing editable metadata (pyproject.toml): started
  Preparing editable metadata (pyproject.toml): finished with status 'done'
Requirement already satisfied: configobj in /usr/lib/python3/dist-packages (from breezy==3.3.3.dev0) (5.0.8)
Requirement already satisfied: fastbencode in /usr/lib/python3/dist-packages (from breezy==3.3.3.dev0) (0.2)
Requirement already satisfied: patiencediff in /usr/lib/python3/dist-packages (from breezy==3.3.3.dev0) (0.2.13)
Requirement already satisfied: merge3 in /usr/lib/python3/dist-packages (from breezy==3.3.3.dev0) (0.0.8)
Requirement already satisfied: dulwich>=0.21.2 in /usr/lib/python3/dist-packages (from breezy==3.3.3.dev0) (0.21.2)
Requirement already satisfied: urllib3>=1.24.1 in /usr/lib/python3/dist-packages (from breezy==3.3.3.dev0) (1.26.12)
Requirement already satisfied: pyyaml in /usr/lib/python3/dist-packages (from breezy==3.3.3.dev0) (6.0)
Collecting testtools
  Downloading testtools-2.6.0-py3-none-any.whl (182 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 182.2/182.2 kB 6.0 MB/s eta 0:00:00
Collecting testscenarios
  Downloading testscenarios-0.5.0-py2.py3-none-any.whl (21 kB)
Collecting python-subunit
  Downloading python_subunit-1.4.2-py3-none-any.whl (106 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 106.8/106.8 kB 5.9 MB/s eta 0:00:00
Requirement already satisfied: flake8 in /usr/lib/python3/dist-packages (from breezy==3.3.3.dev0) (5.0.4)
Collecting cython>=0.29
  Using cached Cython-0.29.33-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (1.9 MB)
Collecting docutils
  Downloading docutils-0.19-py3-none-any.whl (570 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 570.5/570.5 kB 9.6 MB/s eta 0:00:00
Requirement already satisfied: setuptools in ./lib/python3.11/site-packages (from breezy==3.3.3.dev0) (66.1.1)
Collecting sphinx
  Downloading sphinx-6.1.3-py3-none-any.whl (3.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.0/3.0 MB 10.7 MB/s eta 0:00:00
Collecting sphinx-epytext
  Downloading sphinx-epytext-0.0.4.tar.gz (3.6 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting fastimport
  Downloading fastimport-0.9.14.tar.gz (41 kB...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/plugins/launchpad/lp_directory.py'
2--- breezy/plugins/launchpad/lp_directory.py 2023-01-31 01:05:40 +0000
3+++ breezy/plugins/launchpad/lp_directory.py 2023-03-31 15:11:53 +0000
4@@ -20,7 +20,7 @@
5
6 from ... import debug, errors, trace, transport
7 from ...i18n import gettext
8-from ...urlutils import InvalidURL
9+from ...urlutils import InvalidURL, split, join
10 from .account import get_lp_login
11 from .uris import DEFAULT_INSTANCE, LAUNCHPAD_DOMAINS, LPNET_SERVICE_ROOT
12
13@@ -63,10 +63,17 @@
14 def _resolve_via_api(path, url, api_base_url=LPNET_SERVICE_ROOT):
15 from .lp_api import connect_launchpad
16 lp = connect_launchpad(api_base_url, version='devel')
17- lp_branch = lp.branches.getByPath(path=path)
18+ subpaths = []
19+ while path:
20+ lp_branch = lp.branches.getByPath(path=path)
21+ if lp_branch:
22+ break
23+ path, subpath = split(path)
24+ subpaths.insert(0, subpath)
25 if not lp_branch:
26- raise InvalidURL("Unknown Launchpad path: %s" % path)
27- return {'urls': [lp_branch.composePublicURL(scheme='bzr+ssh'), lp_branch.composePublicURL(scheme='http')]}
28+ raise errors.InvalidURL("Unknown Launchpad path: %s" % url)
29+ return {'urls': [join(lp_branch.composePublicURL(scheme='bzr+ssh'), *subpaths),
30+ join(lp_branch.composePublicURL(scheme='http'), *subpaths)]}
31
32
33 class LaunchpadDirectory:

Subscribers

People subscribed via source and target branches