Patchwork [6,of,8] histedit-test: generalise --commands "_" usage

login
register
mail settings
Submitter Pierre-Yves David
Date April 16, 2013, 7:20 p.m.
Message ID <1f9f0a2c3f39564814fb.1366140035@yamac.lan>
Download mbox | patch
Permalink /patch/1363/
State Accepted, archived
Delegated to: Augie Fackler
Headers show

Comments

Pierre-Yves David - April 16, 2013, 7:20 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@logilab.fr>
# Date 1366138738 -7200
# Node ID 1f9f0a2c3f39564814fb977303328f148521e2c3
# Parent  df34ccbcce657753a6311b895278f6f82e629035
histedit-test: generalise --commands "_" usage

This is simpler than temporary file version. There some minor test change for
commit message raison. There is still some test using --commands with a real
file.

Patch

diff --git a/tests/test-histedit-bookmark-motion.t b/tests/test-histedit-bookmark-motion.t
--- a/tests/test-histedit-bookmark-motion.t
+++ b/tests/test-histedit-bookmark-motion.t
@@ -74,18 +74,17 @@ 
   #  f, fold = use commit, but fold into previous commit (combines N and N-1)
   #  d, drop = remove commit from history
   #  m, mess = edit message without changing commit content
   #
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  $ cat >> commands.txt <<EOF
+  $ hg histedit 1 --commands - --verbose << EOF | grep histedit
   > pick 177f92b77385 2 c
   > drop d2ae7f538514 1 b
   > pick 055a42cdd887 3 d
   > fold e860deea161a 4 e
   > pick 652413bf663e 5 f
   > EOF
-  $ hg histedit 1 --commands commands.txt --verbose | grep histedit
   histedit: moving bookmarks also-two from 177f92b77385 to b346ab9a313d
   histedit: moving bookmarks five from 652413bf663e to cacdfd884a93
   histedit: moving bookmarks four from e860deea161a to 59d9f330561f
   histedit: moving bookmarks three from 055a42cdd887 to 59d9f330561f
   histedit: moving bookmarks two from 177f92b77385 to b346ab9a313d
@@ -133,16 +132,15 @@ 
   #  f, fold = use commit, but fold into previous commit (combines N and N-1)
   #  d, drop = remove commit from history
   #  m, mess = edit message without changing commit content
   #
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  $ cat > commands.txt << EOF
+  $ hg histedit 1 --commands - --verbose << EOF | grep histedit
   > pick b346ab9a313d 1 c
   > pick cacdfd884a93 3 f
   > pick 59d9f330561f 2 d
   > EOF
-  $ hg histedit 1 --commands commands.txt --verbose | grep histedit
   histedit: moving bookmarks five from cacdfd884a93 to c04e50810e4b
   histedit: moving bookmarks four from 59d9f330561f to c04e50810e4b
   histedit: moving bookmarks three from 59d9f330561f to c04e50810e4b
   saved backup bundle to $TESTTMP/r/.hg/strip-backup/59d9f330561f-backup.hg (glob)
 
diff --git a/tests/test-histedit-commute.t b/tests/test-histedit-commute.t
--- a/tests/test-histedit-commute.t
+++ b/tests/test-histedit-commute.t
@@ -4,17 +4,10 @@ 
   > [extensions]
   > graphlog=
   > histedit=
   > EOF
 
-  $ EDITED="$TESTTMP/editedhistory"
-  $ cat > $EDITED <<EOF
-  > pick 177f92b77385 c
-  > pick e860deea161a e
-  > pick 652413bf663e f
-  > pick 055a42cdd887 d
-  > EOF
   $ initrepo ()
   > {
   >     hg init r
   >     cd r
   >     for x in a b c d e f ; do
@@ -77,10 +70,19 @@  show the edit commands offered
   #  m, mess = edit message without changing commit content
   #
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 edit the history
+(use a hacky editor to check histedit-last-edit.txt backup)
+
+  $ EDITED="$TESTTMP/editedhistory"
+  $ cat > $EDITED <<EOF
+  > pick 177f92b77385 c
+  > pick e860deea161a e
+  > pick 652413bf663e f
+  > pick 055a42cdd887 d
+  > EOF
   $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
   0 files updated, 0 files merged, 3 files removed, 0 files unresolved
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -126,17 +128,16 @@  log after edit
      summary:     a
   
 
 put things back
 
-  $ cat > $EDITED <<EOF
+  $ hg histedit 177f92b77385 --commands - 2>&1 << EOF | fixbundle
   > pick 177f92b77385 c
   > pick 07114f51870f d
   > pick d8249471110a e
   > pick 8ade9693061e f
   > EOF
-  $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
   0 files updated, 0 files merged, 3 files removed, 0 files unresolved
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
@@ -173,17 +174,16 @@  put things back
      summary:     a
   
 
 slightly different this time
 
-  $ cat > $EDITED <<EOF
+  $ hg histedit 177f92b77385 --commands - << EOF 2>&1 | fixbundle
   > pick 10517e47bbbb d
   > pick 7eca9b5b1148 f
   > pick 915da888f2de e
   > pick 177f92b77385 c
   > EOF
-  $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
   0 files updated, 0 files merged, 4 files removed, 0 files unresolved
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -219,25 +219,20 @@  slightly different this time
      date:        Thu Jan 01 00:00:00 1970 +0000
      summary:     a
   
 
 keep prevents stripping dead revs
-  $ cat > $EDITED <<EOF
+  $ hg histedit 799205341b6b --keep --commands - 2>&1 << EOF | fixbundle
   > pick 799205341b6b d
   > pick be9ae3a309c6 f
   > pick 38b92f448761 c
   > pick de71b079d9ce e
   > EOF
-  $ HGEDITOR="cat \"$EDITED\" > " hg histedit 799205341b6b --keep 2>&1 | fixbundle
   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg log --graph
-  > cat > $EDITED <<EOF
-  > pick de71b079d9ce e
-  > pick 38b92f448761 c
-  > EOF
   @  changeset:   7:803ef1c6fcfd
   |  tag:         tip
   |  user:        test
   |  date:        Thu Jan 01 00:00:00 1970 +0000
   |  summary:     e
@@ -278,11 +273,14 @@  keep prevents stripping dead revs
      date:        Thu Jan 01 00:00:00 1970 +0000
      summary:     a
   
 
 try with --rev
-  $ hg histedit --commands "$EDITED" --rev -2 2>&1 | fixbundle
+  $ hg histedit --commands - --rev -2 2>&1 <<EOF | fixbundle
+  > pick de71b079d9ce e
+  > pick 38b92f448761 c
+  > EOF
   abort: may not use changesets other than the ones listed
   $ hg log --graph
   @  changeset:   7:803ef1c6fcfd
   |  tag:         tip
   |  user:        test
diff --git a/tests/test-histedit-drop.t b/tests/test-histedit-drop.t
--- a/tests/test-histedit-drop.t
+++ b/tests/test-histedit-drop.t
@@ -4,17 +4,10 @@ 
   > [extensions]
   > graphlog=
   > histedit=
   > EOF
 
-  $ EDITED="$TESTTMP/editedhistory"
-  $ cat > $EDITED <<EOF
-  > drop 177f92b77385 c
-  > pick e860deea161a e
-  > pick 652413bf663e f
-  > pick 055a42cdd887 d
-  > EOF
   $ initrepo ()
   > {
   >     hg init r
   >     cd r
   >     for x in a b c d e f ; do
@@ -59,11 +52,16 @@  log before edit
      date:        Thu Jan 01 00:00:00 1970 +0000
      summary:     a
   
 
 edit the history
-  $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
+  $ hg histedit 177f92b77385 --commands - 2>&1 << EOF | fixbundle
+  > drop 177f92b77385 c
+  > pick e860deea161a e
+  > pick 652413bf663e f
+  > pick 055a42cdd887 d
+  > EOF
   0 files updated, 0 files merged, 4 files removed, 0 files unresolved
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
@@ -123,16 +121,15 @@  manifest after edit
   e
   f
 
 Drop the last changeset
 
-  $ cat > $EDITED <<EOF
+  $ hg histedit ee283cb5f2d5 --commands - 2>&1 << EOF | fixbundle
   > pick ee283cb5f2d5 e
   > pick a4f7421b80f7 f
   > drop f518305ce889 d
   > EOF
-  $ HGEDITOR="cat \"$EDITED\" > " hg histedit ee283cb5f2d5 2>&1 | fixbundle
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ hg log --graph
   @  changeset:   3:a4f7421b80f7
   |  tag:         tip
   |  user:        test
diff --git a/tests/test-histedit-edit.t b/tests/test-histedit-edit.t
--- a/tests/test-histedit-edit.t
+++ b/tests/test-histedit-edit.t
@@ -4,17 +4,10 @@ 
   > [extensions]
   > graphlog=
   > histedit=
   > EOF
 
-  $ EDITED="$TESTTMP/editedhistory"
-  $ cat > $EDITED <<EOF
-  > pick 177f92b77385 c
-  > pick 055a42cdd887 d
-  > edit e860deea161a e
-  > pick 652413bf663e f
-  > EOF
   $ initrepo ()
   > {
   >     hg init r
   >     cd r
   >     for x in a b c d e f ; do
@@ -59,11 +52,16 @@  log before edit
      date:        Thu Jan 01 00:00:00 1970 +0000
      summary:     a
   
 
 edit the history
-  $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
+  $ hg histedit 177f92b77385 --commands - 2>&1 << EOF| fixbundle
+  > pick 177f92b77385 c
+  > pick 055a42cdd887 d
+  > edit e860deea161a e
+  > pick 652413bf663e f
+  > EOF
   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
   Make changes as needed, you may commit or record as needed now.
   When you are finished, run hg histedit --continue to resume.
 
 Go at a random point and try to continue
@@ -144,14 +142,13 @@  check histedit_source
   description:
   foobaz
   
   
 
-  $ cat > $EDITED <<EOF
+  $ hg histedit tip --commands - 2>&1 <<EOF| fixbundle
   > edit b5f70786f9b0 f
   > EOF
-  $ HGEDITOR="cat \"$EDITED\" > " hg histedit tip 2>&1 | fixbundle
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   Make changes as needed, you may commit or record as needed now.
   When you are finished, run hg histedit --continue to resume.
   $ hg status
   A f
@@ -186,36 +183,36 @@  say we'll change the message, but don't.
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     f
   
 
 modify the message
-  $ cat > $EDITED <<EOF
+  $ hg histedit tip --commands - 2>&1 << EOF | fixbundle
   > mess 1fd3b2fe7754 f
   > EOF
-  $ HGEDITOR="cat \"$EDITED\" > " hg histedit tip 2>&1 | fixbundle
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg status
   $ hg log --limit 1
-  changeset:   6:5585e802ef99
+  changeset:   6:62feedb1200e
   tag:         tip
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
-  summary:     mess 1fd3b2fe7754 f
+  summary:     f
   
 
 rollback should not work after a histedit
   $ hg rollback
   no rollback information available
   [1]
 
   $ cd ..
   $ hg clone -qr0 r r0
   $ cd r0
-  $ echo edit cb9a9f314b8b a > $EDITED
   $ hg phase -fdr0
-  $ HGEDITOR="cat \"$EDITED\" > " hg histedit 0 2>&1
+  $ hg histedit --commands - 0 2>&1 << EOF
+  > edit cb9a9f314b8b a > $EDITED
+  > EOF
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   adding a
   Make changes as needed, you may commit or record as needed now.
   When you are finished, run hg histedit --continue to resume.
   [1]
diff --git a/tests/test-histedit-fold-non-commute.t b/tests/test-histedit-fold-non-commute.t
--- a/tests/test-histedit-fold-non-commute.t
+++ b/tests/test-histedit-fold-non-commute.t
@@ -84,11 +84,11 @@  log before edit
      date:        Thu Jan 01 00:00:00 1970 +0000
      summary:     Initial commit
   
 
 edit the history
-  $ HGEDITOR="cat \"$EDITED\" > " hg histedit 3 2>&1 | fixbundle
+  $ hg histedit 3 --commands $EDITED 2>&1 | fixbundle
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   merging e
   warning: conflicts during merge.
   merging e incomplete! (edit conflicts, then use 'hg resolve --mark')
   Fix up the change and run hg histedit --continue
diff --git a/tests/test-histedit-fold.t b/tests/test-histedit-fold.t
--- a/tests/test-histedit-fold.t
+++ b/tests/test-histedit-fold.t
@@ -119,18 +119,15 @@  folded content is dropped during a merge
   o  1:617f94f13c0f +4'
   |
   o  0:0189ba417d34 1+2+3'
   
 
-  $ EDITED="$TESTTMP/editedhistory"
-  $ cat > $EDITED <<EOF
+  $ hg histedit 1 --commands - << EOF
   > pick 617f94f13c0f 1 +4
   > drop 888f9082bf99 2 +5
   > fold 251d831eeec5 3 +6
   > EOF
-
-  $ HGEDITOR="cat \"$EDITED\" > " hg histedit 1
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   merging file
   warning: conflicts during merge.
   merging file incomplete! (edit conflicts, then use 'hg resolve --mark')
   Fix up the change and run hg histedit --continue
@@ -182,17 +179,15 @@  dropped revision.
   |
   o  1:617f94f13c0f +4
   |
   o  0:0189ba417d34 1+2+3
   
-  $ EDITED="$TESTTMP/editcommands"
-  $ cat > $EDITED <<EOF
+  $ hg histedit 1 --commands -  << EOF
   > pick 617f94f13c0f 1 +4
   > drop 888f9082bf99 2 +5
   > fold 251d831eeec5 3 +6
   > EOF
-  $ HGEDITOR="cat $EDITED >" hg histedit 1
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   merging file
   warning: conflicts during merge.
   merging file incomplete! (edit conflicts, then use 'hg resolve --mark')
   Fix up the change and run hg histedit --continue
diff --git a/tests/test-histedit-non-commute-abort.t b/tests/test-histedit-non-commute-abort.t
--- a/tests/test-histedit-non-commute-abort.t
+++ b/tests/test-histedit-non-commute-abort.t
@@ -4,18 +4,10 @@ 
   > [extensions]
   > graphlog=
   > histedit=
   > EOF
 
-  $ EDITED="$TESTTMP/editedhistory"
-  $ cat > $EDITED <<EOF
-  > pick 177f92b77385 c
-  > pick 055a42cdd887 d
-  > pick bfa474341cc9 does not commute with e
-  > pick e860deea161a e
-  > pick 652413bf663e f
-  > EOF
   $ initrepo ()
   > {
   >     hg init r
   >     cd r
   >     for x in a b c d e f ; do
@@ -69,11 +61,17 @@  log before edit
      date:        Thu Jan 01 00:00:00 1970 +0000
      summary:     a
   
 
 edit the history
-  $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
+  $ hg histedit 177f92b77385 --commands - 2>&1 <<EOF | fixbundle
+  > pick 177f92b77385 c
+  > pick 055a42cdd887 d
+  > pick bfa474341cc9 does not commute with e
+  > pick e860deea161a e
+  > pick 652413bf663e f
+  > EOF
   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
   remote changed e which local deleted
   use (c)hanged version or leave (d)eleted? c
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   merging e
diff --git a/tests/test-histedit-non-commute.t b/tests/test-histedit-non-commute.t
--- a/tests/test-histedit-non-commute.t
+++ b/tests/test-histedit-non-commute.t
@@ -85,11 +85,11 @@  log before edit
      date:        Thu Jan 01 00:00:00 1970 +0000
      summary:     Initial commit
   
 
 edit the history
-  $ HGEDITOR="cat \"$EDITED\" > " hg histedit 3 2>&1 | fixbundle
+  $ hg histedit 3 --commands $EDITED 2>&1 | fixbundle
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   merging e
   warning: conflicts during merge.
   merging e incomplete! (edit conflicts, then use 'hg resolve --mark')
   Fix up the change and run hg histedit --continue
@@ -143,11 +143,11 @@  second edit set
      date:        Thu Jan 01 00:00:00 1970 +0000
      summary:     Initial commit
   
 
 edit the history
-  $ HGEDITOR="cat \"$EDITED\" > " hg histedit 3 2>&1 | fixbundle
+  $ hg histedit 3 --commands $EDITED 2>&1 | fixbundle
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   merging e
   warning: conflicts during merge.
   merging e incomplete! (edit conflicts, then use 'hg resolve --mark')
   Fix up the change and run hg histedit --continue
@@ -229,20 +229,20 @@  start over
   mess 39522b764e3d 7 does not commute with e
   pick 7b4e2f4b7bcd 5 e
   pick 500cac37a696 6 f
 
 edit the history, this time with a fold action
-  $ HGEDITOR="cat \"$EDITED\" > " hg histedit 3 2>&1 | fixbundle
+  $ hg histedit 3 --commands $EDITED 2>&1 | fixbundle
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   merging e
   warning: conflicts during merge.
   merging e incomplete! (edit conflicts, then use 'hg resolve --mark')
   Fix up the change and run hg histedit --continue
 
   $ echo 'I can haz no commute' > e
   $ hg resolve --mark e
-  $ HGEDITOR="cat \"$EDITED\" > " hg histedit --continue 2>&1 | fixbundle
+  $ hg histedit --commands $EDITED --continue 2>&1 | fixbundle
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   merging e
   warning: conflicts during merge.
   merging e incomplete! (edit conflicts, then use 'hg resolve --mark')
   Fix up the change and run hg histedit --continue
@@ -253,20 +253,20 @@  second edit also fails, but just continu
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 post message fix
   $ hg log --graph
-  @  changeset:   6:521c4c32c5e2
+  @  changeset:   6:7efe1373e4bc
   |  tag:         tip
   |  user:        test
   |  date:        Thu Jan 01 00:00:00 1970 +0000
   |  summary:     f
   |
-  o  changeset:   5:f4f088e8adf6
+  o  changeset:   5:e334d87a1e55
   |  user:        test
   |  date:        Thu Jan 01 00:00:00 1970 +0000
-  |  summary:     pick 65a9a84f33fd 3 c
+  |  summary:     does not commute with e
   |
   o  changeset:   4:00f1c5383965
   |  user:        test
   |  date:        Thu Jan 01 00:00:00 1970 +0000
   |  summary:     d
diff --git a/tests/test-histedit-obsolete.t b/tests/test-histedit-obsolete.t
--- a/tests/test-histedit-obsolete.t
+++ b/tests/test-histedit-obsolete.t
@@ -57,18 +57,17 @@  Enable obsolete
   #  f, fold = use commit, but fold into previous commit (combines N and N-1)
   #  d, drop = remove commit from history
   #  m, mess = edit message without changing commit content
   #
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  $ cat > commands.txt <<EOF
+  $ hg histedit 1 --commands - --verbose <<EOF | grep histedit
   > pick 177f92b77385 2 c
   > drop d2ae7f538514 1 b
   > pick 055a42cdd887 3 d
   > fold e860deea161a 4 e
   > pick 652413bf663e 5 f
   > EOF
-  $ hg histedit 1 --commands commands.txt --verbose | grep histedit
   saved backup bundle to $TESTTMP/base/.hg/strip-backup/96e494a2d553-backup.hg (glob)
   $ hg log --graph --hidden
   @  8:cacdfd884a93 f
   |
   o  7:59d9f330561f d
@@ -98,16 +97,15 @@  Enable obsolete
 Ensure hidden revision does not prevent histedit
 -------------------------------------------------
 
 create an hidden revision
 
-  $ cat > commands.txt <<EOF
+  $ hg histedit 6 --commands - << EOF
   > pick b346ab9a313d 6 c
   > drop 59d9f330561f 7 d
   > pick cacdfd884a93 8 f
   > EOF
-  $ hg histedit 6 --commands commands.txt
   0 files updated, 0 files merged, 3 files removed, 0 files unresolved
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg log --graph
   @  9:c13eb81022ca f
   |
@@ -115,15 +113,14 @@  create an hidden revision
   |
   o  0:cb9a9f314b8b a
   
 check hidden revision are ignored (6 have hidden children 7 and 8)
 
-  $ cat > commands.txt <<EOF
+  $ hg histedit 6 --commands - << EOF
   > pick b346ab9a313d 6 c
   > pick c13eb81022ca 8 f
   > EOF
-  $ hg histedit 6 --commands commands.txt
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 
 
 Test that rewriting leaving instability behind is allowed
@@ -131,14 +128,13 @@  Test that rewriting leaving instability 
 
   $ hg up '.^'
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ hg log -r 'children(.)'
   9:c13eb81022ca f (no-eol)
-  $ cat > commands.txt <<EOF
+  $ hg histedit -r '.' --commands - <<EOF
   > edit b346ab9a313d 6 c
   > EOF
-  $ hg histedit -r '.' --commands commands.txt
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   adding c
   Make changes as needed, you may commit or record as needed now.
   When you are finished, run hg histedit --continue to resume.
   [1]
@@ -162,15 +158,14 @@  dropped changeset to be hidden.
   $ cd ..
   $ hg clone base droplast
   updating to branch default
   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd droplast
-  $ cat > commands.txt <<EOF
+  $ hg histedit -r '40db8afa467b' --commands - << EOF
   > pick 40db8afa467b 10 c
   > drop b449568bf7fc 11 f
   > EOF
-  $ hg histedit -r '40db8afa467b' --commands commands.txt
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ hg log -G
   @  10:40db8afa467b c
   |
   o  0:cb9a9f314b8b a
@@ -182,16 +177,15 @@  With rewritten ancestors
   $ hg add e
   $ hg commit -m g
   $ echo f > f
   $ hg add f
   $ hg commit -m h
-  $ cat > commands.txt <<EOF
+  $ hg histedit -r '40db8afa467b' --commands - << EOF
   > pick 47a8561c0449 12 g
   > pick 40db8afa467b 10 c
   > drop 1b3b05f35ff0 13 h
   > EOF
-  $ hg histedit -r '40db8afa467b' --commands commands.txt
   0 files updated, 0 files merged, 3 files removed, 0 files unresolved
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg log -G
   @  15:ee6544123ab8 c
@@ -265,19 +259,18 @@  phases.new-commit option is.
 
 New-commit as draft (default)
 
   $ cp -r base simple-draft
   $ cd simple-draft
-  $ cat > commands.txt <<EOF
+  $ hg histedit -r 'b449568bf7fc' --commands - << EOF
   > edit b449568bf7fc 11 f
   > pick 6b70183d2492 12 g
   > pick 7395e1ff83bd 13 h
   > pick b605fb7503f2 14 i
   > pick 3a6c53ee7f3d 15 j
   > pick ee118ab9fa44 16 k
   > EOF
-  $ hg histedit -r 'b449568bf7fc' --commands commands.txt
   0 files updated, 0 files merged, 6 files removed, 0 files unresolved
   adding f
   Make changes as needed, you may commit or record as needed now.
   When you are finished, run hg histedit --continue to resume.
   [1]
@@ -315,19 +308,18 @@  New-commit as draft (default)
   $ cd simple-secret
   $ cat >> .hg/hgrc << EOF
   > [phases]
   > new-commit=secret
   > EOF
-  $ cat > commands.txt <<EOF
+  $ hg histedit -r 'b449568bf7fc' --commands - << EOF
   > edit b449568bf7fc 11 f
   > pick 6b70183d2492 12 g
   > pick 7395e1ff83bd 13 h
   > pick b605fb7503f2 14 i
   > pick 3a6c53ee7f3d 15 j
   > pick ee118ab9fa44 16 k
   > EOF
-  $ hg histedit -r 'b449568bf7fc' --commands commands.txt
   0 files updated, 0 files merged, 6 files removed, 0 files unresolved
   adding f
   Make changes as needed, you may commit or record as needed now.
   When you are finished, run hg histedit --continue to resume.
   [1]
@@ -365,19 +357,18 @@  Changeset reordering
 If a secret changeset is put before a draft one, all descendant should be secret.
 It seems more important to present the secret phase.
 
   $ cp -r base reorder
   $ cd reorder
-  $ cat > commands.txt <<EOF
+  $ hg histedit -r 'b449568bf7fc' --commands - << EOF
   > pick b449568bf7fc 11 f
   > pick 3a6c53ee7f3d 15 j
   > pick 6b70183d2492 12 g
   > pick b605fb7503f2 14 i
   > pick 7395e1ff83bd 13 h
   > pick ee118ab9fa44 16 k
   > EOF
-  $ hg histedit -r 'b449568bf7fc' --commands commands.txt
   0 files updated, 0 files merged, 5 files removed, 0 files unresolved
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -413,19 +404,18 @@  Note that there is a few reordering in t
   $ cd folding
   $ cat >> .hg/hgrc << EOF
   > [phases]
   > new-commit=secret
   > EOF
-  $ cat > commands.txt <<EOF
+  $ hg histedit -r 'b449568bf7fc' --commands - << EOF
   > pick 7395e1ff83bd 13 h
   > fold b449568bf7fc 11 f
   > pick 6b70183d2492 12 g
   > fold 3a6c53ee7f3d 15 j
   > pick b605fb7503f2 14 i
   > fold ee118ab9fa44 16 k
   > EOF
-  $ hg histedit -r 'b449568bf7fc' --commands commands.txt
   0 files updated, 0 files merged, 6 files removed, 0 files unresolved
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved