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
=== modified file 'breezy/location.py'
--- breezy/location.py 2020-06-28 23:13:22 +0000
+++ breezy/location.py 2020-11-22 15:23:21 +0000
@@ -83,14 +83,16 @@
8383
84def parse_cvs_location(location):84def parse_cvs_location(location):
85 parts = location.split(':')85 parts = location.split(':')
86 if parts[0] or parts[1] not in ('pserver', 'ssh'):86 if parts[0] or parts[1] not in ('pserver', 'ssh', 'extssh'):
87 raise ValueError('not a valid pserver location string')87 raise ValueError('not a valid CVS location string')
88 try:88 try:
89 (username, hostname) = parts[2].split('@', 1)89 (username, hostname) = parts[2].split('@', 1)
90 except IndexError:90 except IndexError:
91 hostname = parts[2]91 hostname = parts[2]
92 username = None92 username = None
93 scheme = parts[1]93 scheme = parts[1]
94 if scheme == 'extssh':
95 scheme = 'ssh'
94 path = parts[3]96 path = parts[3]
95 return (scheme, hostname, username, path)97 return (scheme, hostname, username, path)
9698
@@ -125,7 +127,7 @@
125 if not isinstance(location, string_types):127 if not isinstance(location, string_types):
126 raise AssertionError("location not a byte or unicode string")128 raise AssertionError("location not a byte or unicode string")
127129
128 if location.startswith(':pserver:'):130 if location.startswith(':pserver:') or location.startswith(':extssh:'):
129 return cvs_to_url(location)131 return cvs_to_url(location)
130132
131 from .directory_service import directories133 from .directory_service import directories
132134
=== modified file 'breezy/tests/test_location.py'
--- breezy/tests/test_location.py 2020-06-28 23:13:22 +0000
+++ breezy/tests/test_location.py 2020-11-22 15:23:21 +0000
@@ -83,6 +83,12 @@
83 ':pserver:anonymous@odessa.cvs.sourceforge.net:/cvsroot/odess'))83 ':pserver:anonymous@odessa.cvs.sourceforge.net:/cvsroot/odess'))
84 self.assertRaises(ValueError, location_to_url, ':pserver:blah')84 self.assertRaises(ValueError, location_to_url, ':pserver:blah')
8585
86 def test_extssh(self):
87 self.assertEqual(
88 'cvs+ssh://anonymous@odessa.cvs.sourceforge.net/cvsroot/odess',
89 location_to_url(
90 ':extssh:anonymous@odessa.cvs.sourceforge.net:/cvsroot/odess'))
91
86 def test_missing_scheme(self):92 def test_missing_scheme(self):
87 self.skipTest('need clever guessing of scheme')93 self.skipTest('need clever guessing of scheme')
88 self.assertEqual(94 self.assertEqual(

Subscribers

People subscribed via source and target branches