[PATCH v3 9/9] remote-bzr: use proper push method
- From
Felipe Contreras <felipe.contreras@gmail.com>
- Date
- Apr 26, 2013, 21:12 UTC
- Message-ID
- <1367010759-17928-10-git-send-email-felipe.contreras@gmail.com>
- In-Reply-To
- <1367010759-17928-1-git-send-email-felipe.contreras@gmail.com>
Not just randomly synchronize the revisions with no checks at all. This is the way bazaar's UI does it.
Also, add a non-ff check.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> --- contrib/remote-helpers/git-remote-bzr | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr index 9f56297..c19ed0e 100755 --- a/contrib/remote-helpers/git-remote-bzr +++ b/contrib/remote-helpers/git-remote-bzr @@ -639,12 +639,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()
-- 1.8.2.1.1031.g2ee5873