Merge lp:~a1s/brz/3.2-windows-local-paths into lp:brz/3.2

Proposed by Aleksandr Smyshliaev
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~a1s/brz/3.2-windows-local-paths
Merge into: lp:brz/3.2
Diff against target: 23 lines (+4/-1)
2 files modified
breezy/location.py (+2/-1)
breezy/tests/test_location.py (+2/-0)
To merge this branch: bzr merge lp:~a1s/brz/3.2-windows-local-paths
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+411937@code.launchpad.net

Commit message

Fix: location_to_url didn't call local_path_to_url for plain ASCII paths

On Windows, this produced "ssh:" urls instead of "file:"

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) :
Revision history for this message
Aleksandr Smyshliaev (a1s) wrote :
Revision history for this message
Jelmer Vernooij (jelmer) :
Revision history for this message
Aleksandr Smyshliaev (a1s) :
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Please add a test in breezy/tests/test_location.py as well?

Revision history for this message
Aleksandr Smyshliaev (a1s) wrote :

> Please add a test in breezy/tests/test_location.py as well?

The test for this is test_location.TestLocationToUrl.test_path, as said in https://bugs.launchpad.net/brz/+bug/1951112

The test is failing without this fix, and passing with it.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

> > Please add a test in breezy/tests/test_location.py as well?
>
> The test for this is test_location.TestLocationToUrl.test_path, as said in
> https://bugs.launchpad.net/brz/+bug/1951112
>
> The test is failing without this fix, and passing with it.
It doesn't fail on Linux without this change, and adding a test will help prevent this regressing.

Revision history for this message
Aleksandr Smyshliaev (a1s) wrote (last edit ):

> > The test for this is test_location.TestLocationToUrl.test_path, as said
> > in https://bugs.launchpad.net/brz/+bug/1951112
> >
> > The test is failing without this fix, and passing with it.
>
> It doesn't fail on Linux without this change, and adding a test will help
> prevent this regressing.

Ah, I see. Ok, here it is.

Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/location.py'
2--- breezy/location.py 2021-06-04 19:21:33 +0000
3+++ breezy/location.py 2021-12-07 13:25:31 +0000
4@@ -47,7 +47,8 @@
5 :return: A URL, e.g. "ssh://foo/bar"
6 :raises ValueError: if this is not a RCP-style URL
7 """
8- m = re.match('^(?P<user>[^@:/]+@)?(?P<host>[^/:]+):(?P<path>.*)$', location)
9+ m = re.match('^(?P<user>[^@:/]+@)?(?P<host>[^/:]{2,}):(?P<path>.*)$',
10+ location)
11 if not m:
12 raise ValueError("Not a RCP URL")
13 if m.group('path').startswith('//'):
14
15=== modified file 'breezy/tests/test_location.py'
16--- breezy/tests/test_location.py 2021-06-04 19:21:33 +0000
17+++ breezy/tests/test_location.py 2021-12-07 13:25:31 +0000
18@@ -131,3 +131,5 @@
19 def test_invalid(self):
20 self.assertRaises(ValueError, rcp_location_to_url, "http://srv/git/bar")
21 self.assertRaises(ValueError, rcp_location_to_url, "git/bar")
22+ # rcp host names cannot be shorter than two characters
23+ self.assertRaises(ValueError, rcp_location_to_url, "c:/git/bar")

Subscribers

People subscribed via source and target branches