[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "No safeguard against rewriting upstream bzr history"

From: Thien-Thi Nguyen
Subject: Re: "No safeguard against rewriting upstream bzr history"
Date: Mon, 06 Jan 2014 10:00:19 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

() Wolfgang Jenkner <address@hidden>
() Sun, 05 Jan 2014 19:38:18 +0100

   So part of the bzrlib safeguard against rewriting history is actually
   in one of the callees of generate_revision_history, while
   git-remote-bzr seems to assume that it is all in push_branch.

Given that the Emacs repo does indeed have that configuration variable
set, sounds like the situation is not actually critical.  Cool.

Nobody has confirmed the sanity check, but w/ this safeguard in place, i
suppose that won't be necessary.  Full speed ahead...

BTW, here is a small patch that makes git-remote-bzr better-behaved:
diff -u /etc/alternatives/ /tmp/git-remote-bzr
--- /etc/alternatives/git-remote-bzr    2013-12-07 00:20:48.000000000 +0100
+++ /tmp/git-remote-bzr 2014-01-06 09:18:59.000000000 +0100
@@ -679,7 +679,21 @@
         if ref.startswith('refs/heads/'):
             name = ref[len('refs/heads/'):]
             branch = get_remote_branch(name)
-            branch.generate_revision_history(revid, marks.get_tip(name))
+            # This alone is not sufficient:
+            #- branch.generate_revision_history(revid, marks.get_tip(name))
+            #
+            # Instead, we need to also handle the situation
+            # where the remote branch is configured with:
+            #   append_revisions_only = True
+            #
+            # TODO: Refactor the "error message and continue".
+            try:
+                branch.generate_revision_history(revid, marks.get_tip(name))
+            except bzrlib.errors.AppendRevisionsOnlyViolation:
+                print "error %s non-fast forward" % ref
+                continue
             if name in peers:
                 peer = bzrlib.branch.Branch.open(peers[name],

I haven't tested it (yet), but anyway hope it, or its essence, can be
incorporated into the next git-remote-bzr release.

Thien-Thi Nguyen
   GPG key: 4C807502
   (if you're human and you know it)
      read my lisp: (responsep (questions 'technical)
                               (not (via 'mailing-list)))
                     => nil

Attachment: pgpwuM4qk_klV.pgp
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]