[Bug 5610] New: rebase transaction with pretxncommit hook regression

mercurial-bugs at mercurial-scm.org mercurial-bugs at mercurial-scm.org
Tue Jun 27 14:16:37 UTC 2017


https://bz.mercurial-scm.org/show_bug.cgi?id=5610

            Bug ID: 5610
           Summary: rebase transaction with pretxncommit hook regression
           Product: Mercurial
           Version: 4.2.1
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: bug
          Priority: wish
         Component: Mercurial
          Assignee: bugzilla at mercurial-scm.org
          Reporter: henriks+hg at unity3d.com
                CC: mercurial-devel at mercurial-scm.org

Around cf8ad0e6c0e4, rebase was placed in a single transaction, but it no
longer takes failures from e.g. pretxncommit into consideration, essentially
breaking `hg rebase --continue` support in this case, unless the hook raises
InterventionRequired. Either we should willingly break backcompat with hooks
and document that, or relax the exception types caught (I'd be strongly
inclined to prefer the latter).

Here's a patch to illustrate the behavior:

diff --git a/tests/test-rebase-interruptions.t
b/tests/test-rebase-interruptions.t
--- a/tests/test-rebase-interruptions.t
+++ b/tests/test-rebase-interruptions.t
@@ -271,4 +271,56 @@ Abort the rebasing:
   |/
   o  0:public 'A'

+
+Test rebase interrupted by hooks (pretxncommit)
+
+  $ hg up 2
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo F > F
+  $ hg add F
+  $ hg ci -m F
+  $ hg rebase --source 2 --dest 5 --tool internal:other --config
'hooks.pretxncommit=hg log -r $HG_NODE | grep "summary:     C"'
+  rebasing 2:965c486023db "C"
+  summary:     C
+  rebasing 6:a0b2430ebfb8 "F" (tip)
+  transaction abort!
+  rollback completed
+  abort: pretxncommit hook exited with status 1
+  [255]
+  $ hg tglogp
+  @  7:secret 'C'
+  |
+  | @  6:secret 'F'
+  | |
+  o |  5:public 'B'
+  | |
+  o |  4:public 'E'
+  | |
+  o |  3:public 'D'
+  | |
+  | o  2:secret 'C'
+  | |
+  | o  1:public 'B'
+  |/
+  o  0:public 'A'
+  
+  $ hg rebase --continue
+  already rebased 2:965c486023db "C" as 401ccec5e39f
+  rebasing 6:a0b2430ebfb8 "F"
+  saved backup bundle to
$TESTTMP/a3/.hg/strip-backup/965c486023db-aa6250e7-backup.hg (glob)
+  $ hg tglogp
+  @  6:secret 'F'
+  |
+  o  5:secret 'C'
+  |
+  o  4:public 'B'
+  |
+  o  3:public 'E'
+  |
+  o  2:public 'D'
+  |
+  | o  1:public 'B'
+  |/
+  o  0:public 'A'
+  
   $ cd ..

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list