Merge lp:~jelmer/brz/fix-foreign-commits into lp:brz

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/fix-foreign-commits
Merge into: lp:brz
Diff against target: 34 lines (+3/-3)
2 files modified
breezy/foreign.py (+2/-2)
breezy/tests/test_foreign.py (+1/-1)
To merge this branch: bzr merge lp:~jelmer/brz/fix-foreign-commits
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Martin Packman Approve
Review via email: mp+358675@code.launchpad.net

Commit message

Fix parsing of foreign revision ids.

Description of the change

Fix parsing of foreign revision ids.

To post a comment you must log in.
Revision history for this message
Martin Packman (gz) wrote :

Thanks!

review: Approve
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :
Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/foreign.py'
2--- breezy/foreign.py 2018-07-19 22:55:15 +0000
3+++ breezy/foreign.py 2018-11-15 22:42:55 +0000
4@@ -171,7 +171,7 @@
5 :param foreign_vcs: ForeignVCS instance
6 :param help: Description of the foreign VCS
7 """
8- if b":" in key or b"-" in key:
9+ if ":" in key or "-" in key:
10 raise ValueError("vcs name can not contain : or -")
11 registry.Registry.register(self, key, foreign_vcs, help)
12
13@@ -185,7 +185,7 @@
14 if b":" not in revid or b"-" not in revid:
15 raise errors.InvalidRevisionId(revid, None)
16 try:
17- foreign_vcs = self.get(revid.split(b"-")[0])
18+ foreign_vcs = self.get(revid.split(b"-")[0].decode('ascii'))
19 except KeyError:
20 raise errors.InvalidRevisionId(revid, None)
21 return foreign_vcs.mapping_registry.revision_id_bzr_to_foreign(revid)
22
23=== modified file 'breezy/tests/test_foreign.py'
24--- breezy/tests/test_foreign.py 2018-08-02 01:10:26 +0000
25+++ breezy/tests/test_foreign.py 2018-11-15 22:42:55 +0000
26@@ -396,7 +396,7 @@
27 def test_parse_revision_id(self):
28 reg = foreign.ForeignVcsRegistry()
29 vcs = DummyForeignVcs()
30- reg.register(b"dummy", vcs, "Dummy VCS")
31+ reg.register("dummy", vcs, "Dummy VCS")
32 self.assertEqual((
33 (b"some", b"foreign", b"revid"), DummyForeignVcsMapping(vcs)),
34 reg.parse_revision_id(b"dummy-v1:some-foreign-revid"))

Subscribers

People subscribed via source and target branches