Erik Zielke avatar Erik Zielke committed 46d2970

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

Comments (0)

Files changed (1)

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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.