Merge lp:~jelmer/brz/cvs-ssh into lp:brz/3.1

Proposed by Jelmer Vernooij
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:~jelmer/brz/cvs-ssh
Merge into: lp:brz/3.1
Diff against target: 48 lines (+11/-3)
2 files modified
breezy/location.py (+5/-3)
breezy/tests/test_location.py (+6/-0)
To merge this branch: bzr merge lp:~jelmer/brz/cvs-ssh
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+394293@code.launchpad.net

Commit message

Add support for converting extssh CVS URLs.

Description of the change

Add support for converting extssh CVS URLs.

To post a comment you must log in.
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 2020-06-28 23:13:22 +0000
3+++ breezy/location.py 2020-11-22 15:23:21 +0000
4@@ -83,14 +83,16 @@
5
6 def parse_cvs_location(location):
7 parts = location.split(':')
8- if parts[0] or parts[1] not in ('pserver', 'ssh'):
9- raise ValueError('not a valid pserver location string')
10+ if parts[0] or parts[1] not in ('pserver', 'ssh', 'extssh'):
11+ raise ValueError('not a valid CVS location string')
12 try:
13 (username, hostname) = parts[2].split('@', 1)
14 except IndexError:
15 hostname = parts[2]
16 username = None
17 scheme = parts[1]
18+ if scheme == 'extssh':
19+ scheme = 'ssh'
20 path = parts[3]
21 return (scheme, hostname, username, path)
22
23@@ -125,7 +127,7 @@
24 if not isinstance(location, string_types):
25 raise AssertionError("location not a byte or unicode string")
26
27- if location.startswith(':pserver:'):
28+ if location.startswith(':pserver:') or location.startswith(':extssh:'):
29 return cvs_to_url(location)
30
31 from .directory_service import directories
32
33=== modified file 'breezy/tests/test_location.py'
34--- breezy/tests/test_location.py 2020-06-28 23:13:22 +0000
35+++ breezy/tests/test_location.py 2020-11-22 15:23:21 +0000
36@@ -83,6 +83,12 @@
37 ':pserver:anonymous@odessa.cvs.sourceforge.net:/cvsroot/odess'))
38 self.assertRaises(ValueError, location_to_url, ':pserver:blah')
39
40+ def test_extssh(self):
41+ self.assertEqual(
42+ 'cvs+ssh://anonymous@odessa.cvs.sourceforge.net/cvsroot/odess',
43+ location_to_url(
44+ ':extssh:anonymous@odessa.cvs.sourceforge.net:/cvsroot/odess'))
45+
46 def test_missing_scheme(self):
47 self.skipTest('need clever guessing of scheme')
48 self.assertEqual(

Subscribers

People subscribed via source and target branches