[PATCH 3 of 5 STABLE] rebase: provides test case for (issue5610)

Pierre-Yves David pierre-yves.david at ens-lyon.org
Tue Jun 27 12:29:34 EDT 2017


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at octobus.net>
# Date 1498578358 -7200
#      Tue Jun 27 17:45:58 2017 +0200
# Branch stable
# Node ID def13cbf1370f763e5fb781b21862b45024ed25d
# Parent  786d7282345f5ffa5348d3c2196f4d6a1bd8b3ce
# EXP-Topic hooks-regression
# Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
#              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r def13cbf1370
rebase: provides test case for (issue5610)

The 4.2 release introduces a regression regarding the behavior of rebase with
some hook failures. We add the tests from the Henrik Stuart bug report from Henrik Stuart to
our test base to prevent further regression on this.

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 ..


More information about the Mercurial-devel mailing list