diff tests/test-rebase-collapse.t @ 20766:95aab23a806b stable

rebase: use "commitforceeditor" instead of "ui.edit()" for "--collapse" Before this patch, "rebase --collapse --edit" without "--message" and "--logfile" invokes editor twice unexpectedly: 1. explicit "ui.edit()" invocation in rebase extension itself 2. indirect invocation in "localrepository.commit()" with "editor = commitforceeditor" assigned by "--edit" option This patch uses indirect "commitforceeditor" invocation instead of "ui.edit()" for "--collapse" without "--message" and "--logfile" to: - suppress redundant the former invocation - ensure editor invocation even when "--edit" is not specified
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Wed, 19 Mar 2014 01:07:41 +0900
parents 7d4219512823
children 18adc15635a1
line wrap: on
line diff
--- a/tests/test-rebase-collapse.t	Wed Mar 19 01:07:41 2014 +0900
+++ b/tests/test-rebase-collapse.t	Wed Mar 19 01:07:41 2014 +0900
@@ -52,14 +52,39 @@
 
   $ hg phase --force --secret 3
 
-  $ hg rebase --collapse --keepbranches
+  $ cat > $TESTTMP/editor.sh <<EOF
+  > echo "==== before editing"
+  > cat \$1
+  > echo "===="
+  > echo "edited manually" >> \$1
+  > EOF
+  $ HGEDITOR="sh $TESTTMP/editor.sh" hg rebase --collapse --keepbranches -e
+  ==== before editing
+  Collapsed revision
+  * B
+  * C
+  * D
+  
+  
+  HG: Enter commit message.  Lines beginning with 'HG:' are removed.
+  HG: Leave message empty to abort commit.
+  HG: --
+  HG: user: Nicolas Dumazet <nicdumz.commits@gmail.com>
+  HG: branch 'default'
+  HG: changed B
+  HG: changed C
+  HG: changed D
+  ====
   saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
 
   $ hg tglogp
   @  5:secret 'Collapsed revision
   |  * B
   |  * C
-  |  * D'
+  |  * D
+  |
+  |
+  |  edited manually'
   o  4:draft 'H'
   |
   | o  3:draft 'G'