Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2013-04-25 15:25:37 +0400
committerJunio C Hamano <gitster@pobox.com>2013-04-26 02:34:37 +0400
commitfbd3f0e53ca9b88709ceadea48d9383c7ffa9382 (patch)
treed6344c557729b44881c38d5c7ffbde0b238a7b7b /contrib
parent6ff8d4e7487c0f48e568b7fd95fa02515a426c1a (diff)
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>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/remote-helpers/git-remote-bzr10
1 files changed, 5 insertions, 5 deletions
diff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr
index fad4a48cdc..6fedc28afb 100755
--- a/contrib/remote-helpers/git-remote-bzr
+++ b/contrib/remote-helpers/git-remote-bzr
@@ -630,12 +630,12 @@ def do_export(parser):
for ref, revid in parsed_refs.iteritems():
if ref == 'refs/heads/master':
repo.generate_revision_history(revid, marks.get_tip('master'))
- revno, revid = repo.last_revision_info()
if peer:
- if hasattr(peer, "import_last_revision_info_and_tags"):
- peer.import_last_revision_info_and_tags(repo, revno, revid)
- else:
- peer.import_last_revision_info(repo.repository, revno, revid)
+ try:
+ repo.push(peer, stop_revision=revid)
+ except bzrlib.errors.DivergedBranches:
+ print "error %s non-fast forward" % ref
+ continue
else:
wt = repo.bzrdir.open_workingtree()
wt.update()