Commits

Anonymous committed 46d2970

Overwriting file, instead of just writing to it, so the tests become correct

  • Participants
  • Parent commits b15910e

Comments (0)

Files changed (1)

File tests/test-editcommitmsgs.t

 Trying to edit commit message, but doesn't do any changes
   $ cat > editor << '__EOF__'
   > #!/bin/sh
+  > echo > $1
   > echo "HG: Enter commit messages for the different patches."  >> $1
   > echo "HG: Lines beginning with 'HG:' is used to apply the" >> $1
   > echo "HG: messages to the right patch, and gives some status on the patch" >> $1
 Trying to edit commit message, add some changes
   $ cat > editor2 << '__EOF__'
   > #!/bin/sh
+  > echo > $1
   > echo "HG: Enter commit messages for the different patches."  >> $1
   > echo "HG: Lines beginning with 'HG:' is used to apply the" >> $1
   > echo "HG: messages to the right patch, and gives some status on the patch" >> $1
 Trying to edit, but removed a comment
   $ cat > editor3 << '__EOF__'
   > #!/bin/sh
+  > echo > $1
   > echo "HG: Enter commit messages for the different patches."  >> $1
   > echo "HG: Lines beginning with 'HG:' is used to apply the" >> $1
   > echo "HG: messages to the right patch, and gives some status on the patch" >> $1
   $ chmod 777 `pwd`/editor3
   $ HGEDITOR="'`pwd`'"/editor3 
   $ hg qeditcommitmsgs
+  abort: Could not find comments for all patches
   $ hg log -l1 --template "{desc}\n"
   This is the third patch
   $ hg log -l1 --template "{desc}\n" -r -2
   This is the second patch
   This is second line of second patch
-  This is the second patch
-  This is second line of second patch
   $ hg log -l1 --template "{desc}\n" -r -3
   This is the first patch
-  This is the first patch
 
 Trying to edit commit message, now shows status info
   $ hg qnew p4
   $ hg qeditcommitmsgs --showstatus
-  patch p4 is empty
+  abort: Could not find comments for all patches