Merge lp:~jelmer/brz/push-non-mainline-to-git 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/push-non-mainline-to-git
Merge into: lp:brz
Diff against target: 42 lines (+20/-1)
2 files modified
breezy/git/branch.py (+4/-1)
breezy/git/tests/test_blackbox.py (+16/-0)
To merge this branch: bzr merge lp:~jelmer/brz/push-non-mainline-to-git
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+368029@code.launchpad.net

This proposal supersedes a proposal from 2019-05-29.

Commit message

Fix pushing non-mainline revisions from bzr to git.

Description of the change

Fix pushing non-mainline revisions from bzr to git.

To post a comment you must log in.
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
=== modified file 'breezy/git/branch.py'
--- breezy/git/branch.py 2019-03-04 05:10:44 +0000
+++ breezy/git/branch.py 2019-06-01 01:24:57 +0000
@@ -1254,7 +1254,10 @@
1254 if stop_revision is None:1254 if stop_revision is None:
1255 (stop_revno, stop_revision) = self.source.last_revision_info()1255 (stop_revno, stop_revision) = self.source.last_revision_info()
1256 elif stop_revno is None:1256 elif stop_revno is None:
1257 stop_revno = self.source.revision_id_to_revno(stop_revision)1257 try:
1258 stop_revno = self.source.revision_id_to_revno(stop_revision)
1259 except errors.NoSuchRevision:
1260 stop_revno = None
1258 if not isinstance(stop_revision, bytes):1261 if not isinstance(stop_revision, bytes):
1259 raise TypeError(stop_revision)1262 raise TypeError(stop_revision)
1260 main_ref = self.target.ref1263 main_ref = self.target.ref
12611264
=== modified file 'breezy/git/tests/test_blackbox.py'
--- breezy/git/tests/test_blackbox.py 2019-05-27 23:59:12 +0000
+++ breezy/git/tests/test_blackbox.py 2019-06-01 01:24:57 +0000
@@ -150,6 +150,22 @@
150 self.assertEqual(b"", output)150 self.assertEqual(b"", output)
151 self.assertTrue(error.endswith(b"Created new branch.\n"))151 self.assertTrue(error.endswith(b"Created new branch.\n"))
152152
153 def test_push_lossy_non_mainline(self):
154 self.run_bzr(['init', '--git', 'bla'])
155 self.run_bzr(['init', 'foo'])
156 self.run_bzr(['commit', '--unchanged', '-m', 'bla', 'foo'])
157 self.run_bzr(['branch', 'foo', 'foo1'])
158 self.run_bzr(['commit', '--unchanged', '-m', 'bla', 'foo1'])
159 self.run_bzr(['commit', '--unchanged', '-m', 'bla', 'foo'])
160 self.run_bzr(['merge', '-d', 'foo', 'foo1'])
161 self.run_bzr(['commit', '--unchanged', '-m', 'merge', 'foo'])
162 output, error = self.run_bzr(['push', '--lossy', '-r1.1.1', '-d', 'foo', 'bla'])
163 self.assertEqual("", output)
164 self.assertEqual(
165 'Pushing from a Bazaar to a Git repository. For better '
166 'performance, push into a Bazaar repository.\n'
167 'Pushed up to revision 2.\n', error)
168
153 def test_log(self):169 def test_log(self):
154 # Smoke test for "bzr log" in a git repository.170 # Smoke test for "bzr log" in a git repository.
155 self.simple_commit()171 self.simple_commit()

Subscribers

People subscribed via source and target branches