comparison tests/test-histedit-fold.t @ 19016:27ec54f2946e

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.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Tue, 16 Apr 2013 20:50:17 +0200
parents 07db88f053fe
children c5c8613f265e
comparison
equal deleted inserted replaced
19015:07db88f053fe 19016:27ec54f2946e
112 $ cd .. 112 $ cd ..
113 113
114 folding and creating no new change doesn't break: 114 folding and creating no new change doesn't break:
115 ------------------------------------------------- 115 -------------------------------------------------
116 116
117 folded content is dropped during a merge. 117 folded content is dropped during a merge. The folded commit should properly disapear.
118 118
119 $ mkdir fold-to-empty-test 119 $ mkdir fold-to-empty-test
120 $ cd fold-to-empty-test 120 $ cd fold-to-empty-test
121 $ hg init 121 $ hg init
122 $ printf "1\n2\n3\n" > file 122 $ printf "1\n2\n3\n" > file
136 o 1:617f94f13c0f +4 136 o 1:617f94f13c0f +4
137 | 137 |
138 o 0:0189ba417d34 1+2+3 138 o 0:0189ba417d34 1+2+3
139 139
140 140
141 $ cat > editor.py <<EOF 141 $ cat > $EDITED <<EOF
142 > import re, sys 142 > pick 617f94f13c0f 1 +4
143 > rules = sys.argv[1] 143 > drop 888f9082bf99 2 +5
144 > data = open(rules).read() 144 > pick 251d831eeec5 3 +6
145 > data = re.sub(r'pick ([0-9a-f]{12} 2 \+5)', r'drop \1', data) 145 > EOF
146 > data = re.sub(r'pick ([0-9a-f]{12} 2 \+6)', r'fold \1', data) 146
147 > open(rules, 'w').write(data) 147 $ HGEDITOR="cat \"$EDITED\" > " hg histedit 1
148 > EOF
149
150 $ HGEDITOR='python editor.py' hg histedit 1
151 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 148 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
152 merging file 149 merging file
153 warning: conflicts during merge. 150 warning: conflicts during merge.
154 merging file incomplete! (edit conflicts, then use 'hg resolve --mark') 151 merging file incomplete! (edit conflicts, then use 'hg resolve --mark')
155 Fix up the change and run hg histedit --continue 152 Fix up the change and run hg histedit --continue
156 [1] 153 [1]
157 There were conflicts, we keep P1 content. This 154 There were conflicts, we keep P1 content. This
158 should effectively drop the changes from +6. 155 should effectively drop the changes from +6.
159 $ hg status 156 $ hg status
160 M file 157 M file
161 ? editor.py
162 ? file.orig 158 ? file.orig
163 $ hg resolve -l 159 $ hg resolve -l
164 U file 160 U file
165 $ hg revert -r 'p1()' file 161 $ hg revert -r 'p1()' file
166 $ hg resolve --mark file 162 $ hg resolve --mark file