histedit-test: replace obscure python script by a plain file
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Tue, 16 Apr 2013 20:50:17 +0200
changeset 19016 27ec54f2946e
parent 19015 07db88f053fe
child 19017 c5c8613f265e
histedit-test: replace obscure python script by a plain file One of the tests uses a python script to edit the histedit commands on the fly. It was hard to read and likely to break. This is replaced by a plain command file. Doing so made me discover that the python script is incorrect. The "+6" regexp never matched because the revision number is wrong. This error is kept in the replacement for now. Fixing the histedit command triggers a traceback in histedit. A later changeset will fix the error and restore the intended test.
tests/test-histedit-fold.t
--- a/tests/test-histedit-fold.t	Tue Apr 16 16:22:38 2013 +0200
+++ b/tests/test-histedit-fold.t	Tue Apr 16 20:50:17 2013 +0200
@@ -114,7 +114,7 @@
 folding and creating no new change doesn't break:
 -------------------------------------------------
 
-folded content is dropped during a merge.
+folded content is dropped during a merge. The folded commit should properly disapear.
 
   $ mkdir fold-to-empty-test
   $ cd fold-to-empty-test
@@ -138,16 +138,13 @@
   o  0:0189ba417d34 1+2+3
   
 
-  $ cat > editor.py <<EOF
-  > import re, sys
-  > rules = sys.argv[1]
-  > data = open(rules).read()
-  > data = re.sub(r'pick ([0-9a-f]{12} 2 \+5)', r'drop \1', data)
-  > data = re.sub(r'pick ([0-9a-f]{12} 2 \+6)', r'fold \1', data)
-  > open(rules, 'w').write(data)
+  $ cat > $EDITED <<EOF
+  > pick 617f94f13c0f 1 +4
+  > drop 888f9082bf99 2 +5
+  > pick 251d831eeec5 3 +6
   > EOF
 
-  $ HGEDITOR='python editor.py' hg histedit 1
+  $ HGEDITOR="cat \"$EDITED\" > " hg histedit 1
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   merging file
   warning: conflicts during merge.
@@ -158,7 +155,6 @@
 should effectively drop the changes from +6.
   $ hg status
   M file
-  ? editor.py
   ? file.orig
   $ hg resolve -l
   U file