##// END OF EJS Templates
tests: add "(glob)" to output in test-histedit-commute.t for Windows...
Matt Harbison -
r23921:387d6cbb stable
parent child Browse files
Show More
@@ -1,459 +1,459
1 1 $ . "$TESTDIR/histedit-helpers.sh"
2 2
3 3 $ cat >> $HGRCPATH <<EOF
4 4 > [extensions]
5 5 > histedit=
6 6 > EOF
7 7
8 8 $ initrepo ()
9 9 > {
10 10 > hg init r
11 11 > cd r
12 12 > for x in a b c d e f ; do
13 13 > echo $x > $x
14 14 > hg add $x
15 15 > hg ci -m $x
16 16 > done
17 17 > }
18 18
19 19 $ initrepo
20 20
21 21 log before edit
22 22 $ hg log --graph
23 23 @ changeset: 5:652413bf663e
24 24 | tag: tip
25 25 | user: test
26 26 | date: Thu Jan 01 00:00:00 1970 +0000
27 27 | summary: f
28 28 |
29 29 o changeset: 4:e860deea161a
30 30 | user: test
31 31 | date: Thu Jan 01 00:00:00 1970 +0000
32 32 | summary: e
33 33 |
34 34 o changeset: 3:055a42cdd887
35 35 | user: test
36 36 | date: Thu Jan 01 00:00:00 1970 +0000
37 37 | summary: d
38 38 |
39 39 o changeset: 2:177f92b77385
40 40 | user: test
41 41 | date: Thu Jan 01 00:00:00 1970 +0000
42 42 | summary: c
43 43 |
44 44 o changeset: 1:d2ae7f538514
45 45 | user: test
46 46 | date: Thu Jan 01 00:00:00 1970 +0000
47 47 | summary: b
48 48 |
49 49 o changeset: 0:cb9a9f314b8b
50 50 user: test
51 51 date: Thu Jan 01 00:00:00 1970 +0000
52 52 summary: a
53 53
54 54
55 55 show the edit commands offered
56 56 $ HGEDITOR=cat hg histedit 177f92b77385
57 57 pick 177f92b77385 2 c
58 58 pick 055a42cdd887 3 d
59 59 pick e860deea161a 4 e
60 60 pick 652413bf663e 5 f
61 61
62 62 # Edit history between 177f92b77385 and 652413bf663e
63 63 #
64 64 # Commits are listed from least to most recent
65 65 #
66 66 # Commands:
67 67 # p, pick = use commit
68 68 # e, edit = use commit, but stop for amending
69 69 # f, fold = use commit, but combine it with the one above
70 70 # r, roll = like fold, but discard this commit's description
71 71 # d, drop = remove commit from history
72 72 # m, mess = edit message without changing commit content
73 73 #
74 74 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
75 75
76 76 edit the history
77 77 (use a hacky editor to check histedit-last-edit.txt backup)
78 78
79 79 $ EDITED="$TESTTMP/editedhistory"
80 80 $ cat > $EDITED <<EOF
81 81 > pick 177f92b77385 c
82 82 > pick e860deea161a e
83 83 > pick 652413bf663e f
84 84 > pick 055a42cdd887 d
85 85 > EOF
86 86 $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
87 87 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
88 88 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
89 89 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
90 90 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
91 91
92 92 rules should end up in .hg/histedit-last-edit.txt:
93 93 $ cat .hg/histedit-last-edit.txt
94 94 pick 177f92b77385 c
95 95 pick e860deea161a e
96 96 pick 652413bf663e f
97 97 pick 055a42cdd887 d
98 98
99 99 log after edit
100 100 $ hg log --graph
101 101 @ changeset: 5:07114f51870f
102 102 | tag: tip
103 103 | user: test
104 104 | date: Thu Jan 01 00:00:00 1970 +0000
105 105 | summary: d
106 106 |
107 107 o changeset: 4:8ade9693061e
108 108 | user: test
109 109 | date: Thu Jan 01 00:00:00 1970 +0000
110 110 | summary: f
111 111 |
112 112 o changeset: 3:d8249471110a
113 113 | user: test
114 114 | date: Thu Jan 01 00:00:00 1970 +0000
115 115 | summary: e
116 116 |
117 117 o changeset: 2:177f92b77385
118 118 | user: test
119 119 | date: Thu Jan 01 00:00:00 1970 +0000
120 120 | summary: c
121 121 |
122 122 o changeset: 1:d2ae7f538514
123 123 | user: test
124 124 | date: Thu Jan 01 00:00:00 1970 +0000
125 125 | summary: b
126 126 |
127 127 o changeset: 0:cb9a9f314b8b
128 128 user: test
129 129 date: Thu Jan 01 00:00:00 1970 +0000
130 130 summary: a
131 131
132 132
133 133 put things back
134 134
135 135 $ hg histedit 177f92b77385 --commands - 2>&1 << EOF | fixbundle
136 136 > pick 177f92b77385 c
137 137 > pick 07114f51870f d
138 138 > pick d8249471110a e
139 139 > pick 8ade9693061e f
140 140 > EOF
141 141 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
142 142 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
143 143 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
144 144 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
145 145
146 146 $ hg log --graph
147 147 @ changeset: 5:7eca9b5b1148
148 148 | tag: tip
149 149 | user: test
150 150 | date: Thu Jan 01 00:00:00 1970 +0000
151 151 | summary: f
152 152 |
153 153 o changeset: 4:915da888f2de
154 154 | user: test
155 155 | date: Thu Jan 01 00:00:00 1970 +0000
156 156 | summary: e
157 157 |
158 158 o changeset: 3:10517e47bbbb
159 159 | user: test
160 160 | date: Thu Jan 01 00:00:00 1970 +0000
161 161 | summary: d
162 162 |
163 163 o changeset: 2:177f92b77385
164 164 | user: test
165 165 | date: Thu Jan 01 00:00:00 1970 +0000
166 166 | summary: c
167 167 |
168 168 o changeset: 1:d2ae7f538514
169 169 | user: test
170 170 | date: Thu Jan 01 00:00:00 1970 +0000
171 171 | summary: b
172 172 |
173 173 o changeset: 0:cb9a9f314b8b
174 174 user: test
175 175 date: Thu Jan 01 00:00:00 1970 +0000
176 176 summary: a
177 177
178 178
179 179 slightly different this time
180 180
181 181 $ hg histedit 177f92b77385 --commands - << EOF 2>&1 | fixbundle
182 182 > pick 10517e47bbbb d
183 183 > pick 7eca9b5b1148 f
184 184 > pick 915da888f2de e
185 185 > pick 177f92b77385 c
186 186 > EOF
187 187 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
188 188 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
189 189 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
190 190 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
191 191 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
192 192 $ hg log --graph
193 193 @ changeset: 5:38b92f448761
194 194 | tag: tip
195 195 | user: test
196 196 | date: Thu Jan 01 00:00:00 1970 +0000
197 197 | summary: c
198 198 |
199 199 o changeset: 4:de71b079d9ce
200 200 | user: test
201 201 | date: Thu Jan 01 00:00:00 1970 +0000
202 202 | summary: e
203 203 |
204 204 o changeset: 3:be9ae3a309c6
205 205 | user: test
206 206 | date: Thu Jan 01 00:00:00 1970 +0000
207 207 | summary: f
208 208 |
209 209 o changeset: 2:799205341b6b
210 210 | user: test
211 211 | date: Thu Jan 01 00:00:00 1970 +0000
212 212 | summary: d
213 213 |
214 214 o changeset: 1:d2ae7f538514
215 215 | user: test
216 216 | date: Thu Jan 01 00:00:00 1970 +0000
217 217 | summary: b
218 218 |
219 219 o changeset: 0:cb9a9f314b8b
220 220 user: test
221 221 date: Thu Jan 01 00:00:00 1970 +0000
222 222 summary: a
223 223
224 224
225 225 keep prevents stripping dead revs
226 226 $ hg histedit 799205341b6b --keep --commands - 2>&1 << EOF | fixbundle
227 227 > pick 799205341b6b d
228 228 > pick be9ae3a309c6 f
229 229 > pick 38b92f448761 c
230 230 > pick de71b079d9ce e
231 231 > EOF
232 232 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
233 233 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
234 234 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
235 235 $ hg log --graph
236 236 @ changeset: 7:803ef1c6fcfd
237 237 | tag: tip
238 238 | user: test
239 239 | date: Thu Jan 01 00:00:00 1970 +0000
240 240 | summary: e
241 241 |
242 242 o changeset: 6:ece0b8d93dda
243 243 | parent: 3:be9ae3a309c6
244 244 | user: test
245 245 | date: Thu Jan 01 00:00:00 1970 +0000
246 246 | summary: c
247 247 |
248 248 | o changeset: 5:38b92f448761
249 249 | | user: test
250 250 | | date: Thu Jan 01 00:00:00 1970 +0000
251 251 | | summary: c
252 252 | |
253 253 | o changeset: 4:de71b079d9ce
254 254 |/ user: test
255 255 | date: Thu Jan 01 00:00:00 1970 +0000
256 256 | summary: e
257 257 |
258 258 o changeset: 3:be9ae3a309c6
259 259 | user: test
260 260 | date: Thu Jan 01 00:00:00 1970 +0000
261 261 | summary: f
262 262 |
263 263 o changeset: 2:799205341b6b
264 264 | user: test
265 265 | date: Thu Jan 01 00:00:00 1970 +0000
266 266 | summary: d
267 267 |
268 268 o changeset: 1:d2ae7f538514
269 269 | user: test
270 270 | date: Thu Jan 01 00:00:00 1970 +0000
271 271 | summary: b
272 272 |
273 273 o changeset: 0:cb9a9f314b8b
274 274 user: test
275 275 date: Thu Jan 01 00:00:00 1970 +0000
276 276 summary: a
277 277
278 278
279 279 try with --rev
280 280 $ hg histedit --commands - --rev -2 2>&1 <<EOF | fixbundle
281 281 > pick de71b079d9ce e
282 282 > pick 38b92f448761 c
283 283 > EOF
284 284 abort: may not use changesets other than the ones listed
285 285 $ hg log --graph
286 286 @ changeset: 7:803ef1c6fcfd
287 287 | tag: tip
288 288 | user: test
289 289 | date: Thu Jan 01 00:00:00 1970 +0000
290 290 | summary: e
291 291 |
292 292 o changeset: 6:ece0b8d93dda
293 293 | parent: 3:be9ae3a309c6
294 294 | user: test
295 295 | date: Thu Jan 01 00:00:00 1970 +0000
296 296 | summary: c
297 297 |
298 298 | o changeset: 5:38b92f448761
299 299 | | user: test
300 300 | | date: Thu Jan 01 00:00:00 1970 +0000
301 301 | | summary: c
302 302 | |
303 303 | o changeset: 4:de71b079d9ce
304 304 |/ user: test
305 305 | date: Thu Jan 01 00:00:00 1970 +0000
306 306 | summary: e
307 307 |
308 308 o changeset: 3:be9ae3a309c6
309 309 | user: test
310 310 | date: Thu Jan 01 00:00:00 1970 +0000
311 311 | summary: f
312 312 |
313 313 o changeset: 2:799205341b6b
314 314 | user: test
315 315 | date: Thu Jan 01 00:00:00 1970 +0000
316 316 | summary: d
317 317 |
318 318 o changeset: 1:d2ae7f538514
319 319 | user: test
320 320 | date: Thu Jan 01 00:00:00 1970 +0000
321 321 | summary: b
322 322 |
323 323 o changeset: 0:cb9a9f314b8b
324 324 user: test
325 325 date: Thu Jan 01 00:00:00 1970 +0000
326 326 summary: a
327 327
328 328 Verify that revsetalias entries work with histedit:
329 329 $ cat >> $HGRCPATH <<EOF
330 330 > [revsetalias]
331 331 > grandparent(ARG) = p1(p1(ARG))
332 332 > EOF
333 333 $ echo extra commit >> c
334 334 $ hg ci -m 'extra commit to c'
335 335 $ HGEDITOR=cat hg histedit 'grandparent(.)'
336 336 pick ece0b8d93dda 6 c
337 337 pick 803ef1c6fcfd 7 e
338 338 pick 9c863c565126 8 extra commit to c
339 339
340 340 # Edit history between ece0b8d93dda and 9c863c565126
341 341 #
342 342 # Commits are listed from least to most recent
343 343 #
344 344 # Commands:
345 345 # p, pick = use commit
346 346 # e, edit = use commit, but stop for amending
347 347 # f, fold = use commit, but combine it with the one above
348 348 # r, roll = like fold, but discard this commit's description
349 349 # d, drop = remove commit from history
350 350 # m, mess = edit message without changing commit content
351 351 #
352 352 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
353 353
354 354 should also work if a commit message is missing
355 355 $ BUNDLE="$TESTDIR/missing-comment.hg"
356 356 $ hg init missing
357 357 $ cd missing
358 358 $ hg unbundle $BUNDLE
359 359 adding changesets
360 360 adding manifests
361 361 adding file changes
362 362 added 3 changesets with 3 changes to 1 files
363 363 (run 'hg update' to get a working copy)
364 364 $ hg co tip
365 365 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
366 366 $ hg log --graph
367 367 @ changeset: 2:bd22688093b3
368 368 | tag: tip
369 369 | user: Robert Altman <robert.altman@telventDTN.com>
370 370 | date: Mon Nov 28 16:40:04 2011 +0000
371 371 | summary: Update file.
372 372 |
373 373 o changeset: 1:3b3e956f9171
374 374 | user: Robert Altman <robert.altman@telventDTN.com>
375 375 | date: Mon Nov 28 16:37:57 2011 +0000
376 376 |
377 377 o changeset: 0:141947992243
378 378 user: Robert Altman <robert.altman@telventDTN.com>
379 379 date: Mon Nov 28 16:35:28 2011 +0000
380 380 summary: Checked in text file
381 381
382 382 $ hg histedit 0
383 383 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
384 384 $ cd ..
385 385
386 386 $ cd ..
387 387
388 388
389 389 Test to make sure folding renames doesn't cause bogus conflicts (issue4251):
390 390 $ hg init issue4251
391 391 $ cd issue4251
392 392
393 393 $ mkdir initial-dir
394 394 $ echo foo > initial-dir/initial-file
395 395 $ hg add initial-dir/initial-file
396 396 $ hg commit -m "initial commit"
397 397
398 398 Move the file to a new directory, and in the same commit, change its content:
399 399 $ mkdir another-dir
400 400 $ hg mv initial-dir/initial-file another-dir/
401 401 $ echo changed > another-dir/initial-file
402 402 $ hg commit -m "moved and changed"
403 403
404 404 Rename the file:
405 405 $ hg mv another-dir/initial-file another-dir/renamed-file
406 406 $ hg commit -m "renamed"
407 407
408 408 Now, let's try to fold the second commit into the first:
409 409 $ cat > editor.sh <<EOF
410 410 > #!/bin/sh
411 411 > cat > \$1 <<ENDOF
412 412 > pick b0f4233702ca 0 initial commit
413 413 > fold 5e8704a8f2d2 1 moved and changed
414 414 > pick 40e7299e8fa7 2 renamed
415 415 > ENDOF
416 416 > EOF
417 417
418 418 $ HGEDITOR="sh ./editor.sh" hg histedit 0
419 419 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
420 adding another-dir/initial-file
421 removing initial-dir/initial-file
420 adding another-dir/initial-file (glob)
421 removing initial-dir/initial-file (glob)
422 422 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
423 423 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
424 424 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
425 425 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
426 426 saved backup bundle to $TESTTMP/issue4251/.hg/strip-backup/*-backup.hg (glob)
427 427
428 428 $ hg --config diff.git=yes export 0
429 429 # HG changeset patch
430 430 # User test
431 431 # Date 0 0
432 432 # Thu Jan 01 00:00:00 1970 +0000
433 433 # Node ID fffadc26f8f85623ce60b028a3f1ccc3730f8530
434 434 # Parent 0000000000000000000000000000000000000000
435 435 pick b0f4233702ca 0 initial commit
436 436 fold 5e8704a8f2d2 1 moved and changed
437 437 pick 40e7299e8fa7 2 renamed
438 438
439 439 diff --git a/another-dir/initial-file b/another-dir/initial-file
440 440 new file mode 100644
441 441 --- /dev/null
442 442 +++ b/another-dir/initial-file
443 443 @@ -0,0 +1,1 @@
444 444 +changed
445 445
446 446 $ hg --config diff.git=yes export 1
447 447 # HG changeset patch
448 448 # User test
449 449 # Date 0 0
450 450 # Thu Jan 01 00:00:00 1970 +0000
451 451 # Node ID 9b730d82b00af8a2766facebfa47cc124405a118
452 452 # Parent fffadc26f8f85623ce60b028a3f1ccc3730f8530
453 453 renamed
454 454
455 455 diff --git a/another-dir/initial-file b/another-dir/renamed-file
456 456 rename from another-dir/initial-file
457 457 rename to another-dir/renamed-file
458 458
459 459 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now