comparison tests/test-histedit-fold.t @ 17242:336121088ef1 stable

histedit: fix new nodes computation with --continue (issue3534) When running the following actions: pick 617f94f13c0f 1 +4 drop 888f9082bf99 2 +5 fold 251d831eeec5 3 +6 if the fold fails, is fixed by the user with a new changeset, --continue will ignore the new revision when generating the fold changelog. This was caused by --continue detecting new changesets as descendants of the parent not descendants of changesets in the initial list. In this case, dropped changesets must be ignored. Even with the computation fixed, the 'newchildren' list was always emptied by the filtering loop and passed empty to finishfold(). Note that changesets dropped and recreated identically will still be missed. This probably cannot be solved but is unlikely to happen. Other things, like 'newchildren' having multiple heads, should be checked as well.
author Patrick Mezard <patrick@mezard.eu>
date Wed, 25 Jul 2012 16:27:26 +0200
parents 0a48f3d54543
children d9626b91623a
comparison
equal deleted inserted replaced
17241:c2f13180001f 17242:336121088ef1
181 date: Thu Jan 01 00:00:00 1970 +0000 181 date: Thu Jan 01 00:00:00 1970 +0000
182 summary: 1+2+3 182 summary: 1+2+3
183 183
184 184
185 $ cd .. 185 $ cd ..
186
187 Test corner case where folded revision is separated from its parent by a
188 dropped revision.
189
190
191 $ hg init fold-with-dropped
192 $ cd fold-with-dropped
193 $ printf "1\n2\n3\n" > file
194 $ hg commit -Am '1+2+3'
195 adding file
196 $ echo 4 >> file
197 $ hg commit -m '+4'
198 $ echo 5 >> file
199 $ hg commit -m '+5'
200 $ echo 6 >> file
201 $ hg commit -m '+6'
202 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
203 @ 3:251d831eeec5 +6
204 |
205 o 2:888f9082bf99 +5
206 |
207 o 1:617f94f13c0f +4
208 |
209 o 0:0189ba417d34 1+2+3
210
211 $ EDITED=`pwd`/../editcommands
212 $ cat > $EDITED <<EOF
213 > pick 617f94f13c0f 1 +4
214 > drop 888f9082bf99 2 +5
215 > fold 251d831eeec5 3 +6
216 > EOF
217 $ HGEDITOR="cat $EDITED >" hg histedit 1
218 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
219 patching file file
220 Hunk #1 FAILED at 2
221 1 out of 1 hunks FAILED -- saving rejects to file file.rej
222 abort: Fix up the change and run hg histedit --continue
223 [255]
224 $ echo 5 >> file
225 $ hg commit -m '+5.2'
226 created new head
227 $ echo 6 >> file
228 $ HGEDITOR=cat hg histedit --continue
229 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
230 +4
231 ***
232 +5.2
233 ***
234 +6
235 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
236 saved backup bundle to $TESTTMP/fold-with-dropped/.hg/strip-backup/617f94f13c0f-backup.hg (glob)
237 $ cd ..
238