Skip to content

Commit fbd3f0e

Browse files
Felipe Contrerasgitster
authored andcommitted
remote-bzr: use proper push method
Do not just randomly synchronize the revisions with no checks at all. I don't have any evidence that there's anything wrong with the current code, which Bazaar seems to use, but for different purposes. Let's use the logic Bazaar UI uses to avoid surprises. Also, add a non-ff check. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 6ff8d4e commit fbd3f0e

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

contrib/remote-helpers/git-remote-bzr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -630,12 +630,12 @@ def do_export(parser):
630630
for ref, revid in parsed_refs.iteritems():
631631
if ref == 'refs/heads/master':
632632
repo.generate_revision_history(revid, marks.get_tip('master'))
633-
revno, revid = repo.last_revision_info()
634633
if peer:
635-
if hasattr(peer, "import_last_revision_info_and_tags"):
636-
peer.import_last_revision_info_and_tags(repo, revno, revid)
637-
else:
638-
peer.import_last_revision_info(repo.repository, revno, revid)
634+
try:
635+
repo.push(peer, stop_revision=revid)
636+
except bzrlib.errors.DivergedBranches:
637+
print "error %s non-fast forward" % ref
638+
continue
639639
else:
640640
wt = repo.bzrdir.open_workingtree()
641641
wt.update()

0 commit comments

Comments
 (0)