Patchwork [5,of,5,STABLE] rebase: also test abort from pretxnclose error

login
register
mail settings
Submitter Pierre-Yves David
Date June 27, 2017, 4:29 p.m.
Message ID <465af5c81d26288b1e9c.1498580976@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/21781/
State Accepted
Headers show

Comments

Pierre-Yves David - June 27, 2017, 4:29 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1498579990 -7200
#      Tue Jun 27 18:13:10 2017 +0200
# Branch stable
# Node ID 465af5c81d26288b1e9cd8f26290877716a0bf55
# Parent  59a0ce622d556d26feb3c943da75fd46d547d3f8
# 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 465af5c81d26
rebase: also test abort from pretxnclose error

Different hooks will have different properties so we cover more hooks to catch
further regressions.
via Mercurial-devel - June 28, 2017, 8:52 p.m.
On Tue, Jun 27, 2017 at 9:29 AM, Pierre-Yves David
<pierre-yves.david@ens-lyon.org> wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@octobus.net>
> # Date 1498579990 -7200
> #      Tue Jun 27 18:13:10 2017 +0200
> # Branch stable
> # Node ID 465af5c81d26288b1e9cd8f26290877716a0bf55
> # Parent  59a0ce622d556d26feb3c943da75fd46d547d3f8
> # 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 465af5c81d26
> rebase: also test abort from pretxnclose error

Queued, thanks!
via Mercurial-devel - June 29, 2017, 10:41 p.m.
On Wed, Jun 28, 2017 at 1:52 PM, Martin von Zweigbergk
<martinvonz@google.com> wrote:
> On Tue, Jun 27, 2017 at 9:29 AM, Pierre-Yves David
> <pierre-yves.david@ens-lyon.org> wrote:
>> # HG changeset patch
>> # User Pierre-Yves David <pierre-yves.david@octobus.net>
>> # Date 1498579990 -7200
>> #      Tue Jun 27 18:13:10 2017 +0200
>> # Branch stable
>> # Node ID 465af5c81d26288b1e9cd8f26290877716a0bf55
>> # Parent  59a0ce622d556d26feb3c943da75fd46d547d3f8
>> # 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 465af5c81d26
>> rebase: also test abort from pretxnclose error
>
> Queued, thanks!

I apparently never pushed this :-( Thanks to Durham for reminding me.
Should be pushed now.

Note that this makes the fix for
https://bz.mercurial-scm.org/show_bug.cgi?id=5581 that Sid did in
https://www.mercurial-scm.org/repo/hg/rev/15e85dded933 ineffective, so
the test case fails again when this series is fixed into the default
branch. I've fixed the test case so it passed with the bad output (I
added a "BROKEN:" label too).

Patch

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
@@ -379,3 +379,53 @@  Test rebase interrupted by hooks
   o  0:public 'A'
   
   $ cd ..
+
+(pretxnclose version)
+
+  $ cp -R a3 hook-pretxnclose
+  $ cd hook-pretxnclose
+  $ hg rebase --source 2 --dest 5 --tool internal:other --config 'hooks.pretxnclose=hg log -r tip | grep "summary:     C"'
+  rebasing 2:965c486023db "C"
+  summary:     C
+  rebasing 6:a0b2430ebfb8 "F" (tip)
+  transaction abort!
+  rollback completed
+  abort: pretxnclose 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/hook-pretxnclose/.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 ..