mirror of
https://github.com/git/git
synced 2024-11-05 18:59:29 +00:00
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>
This commit is contained in:
parent
6ff8d4e748
commit
fbd3f0e53c
1 changed files with 5 additions and 5 deletions
|
@ -630,12 +630,12 @@ def do_export(parser):
|
||||||
for ref, revid in parsed_refs.iteritems():
|
for ref, revid in parsed_refs.iteritems():
|
||||||
if ref == 'refs/heads/master':
|
if ref == 'refs/heads/master':
|
||||||
repo.generate_revision_history(revid, marks.get_tip('master'))
|
repo.generate_revision_history(revid, marks.get_tip('master'))
|
||||||
revno, revid = repo.last_revision_info()
|
|
||||||
if peer:
|
if peer:
|
||||||
if hasattr(peer, "import_last_revision_info_and_tags"):
|
try:
|
||||||
peer.import_last_revision_info_and_tags(repo, revno, revid)
|
repo.push(peer, stop_revision=revid)
|
||||||
else:
|
except bzrlib.errors.DivergedBranches:
|
||||||
peer.import_last_revision_info(repo.repository, revno, revid)
|
print "error %s non-fast forward" % ref
|
||||||
|
continue
|
||||||
else:
|
else:
|
||||||
wt = repo.bzrdir.open_workingtree()
|
wt = repo.bzrdir.open_workingtree()
|
||||||
wt.update()
|
wt.update()
|
||||||
|
|
Loading…
Reference in a new issue