comparison tests/test-rebase-interruptions.t @ 35385:469b06b4c3ca

tests: add commit hashes to log commands in rebase tests Commit hashes are a useful way to ensure the content of commits made in the tests are not changing, even if we don't query every aspect of every commit. (And some properties, like extras, are rarely printed at all.) Many of the rebase log -G calls didn't show hashes; by adding hashes to places that weren't showing them we can help protect those tests from unwanted changes. Differential Revision: https://phab.mercurial-scm.org/D1650
author Phil Cohen <phillco@fb.com>
date Sun, 10 Dec 2017 21:57:37 -0800
parents 3b7cb3d17137
children 4441705b7111
comparison
equal deleted inserted replaced
35384:b9bdee046cc2 35385:469b06b4c3ca
4 > 4 >
5 > [phases] 5 > [phases]
6 > publish=False 6 > publish=False
7 > 7 >
8 > [alias] 8 > [alias]
9 > tglog = log -G --template "{rev}: '{desc}' {branches}\n" 9 > tglog = log -G --template "{rev}: {node|short} '{desc}' {branches}\n"
10 > tglogp = log -G --template "{rev}:{phase} '{desc}' {branches}\n" 10 > tglogp = log -G --template "{rev}: {node|short} {phase} '{desc}' {branches}\n"
11 > EOF 11 > EOF
12 12
13 13
14 $ hg init a 14 $ hg init a
15 $ cd a 15 $ cd a
42 42
43 $ hg clone -q -u . a a1 43 $ hg clone -q -u . a a1
44 $ cd a1 44 $ cd a1
45 45
46 $ hg tglog 46 $ hg tglog
47 @ 4: 'E' 47 @ 4: ae36e8e3dfd7 'E'
48 | 48 |
49 o 3: 'D' 49 o 3: 46b37eabc604 'D'
50 | 50 |
51 | o 2: 'C' 51 | o 2: 965c486023db 'C'
52 | | 52 | |
53 | o 1: 'B' 53 | o 1: 27547f69f254 'B'
54 |/ 54 |/
55 o 0: 'A' 55 o 0: 4a2df7238c3b 'A'
56 56
57 Rebasing B onto E: 57 Rebasing B onto E:
58 58
59 $ hg rebase -s 1 -d 4 59 $ hg rebase -s 1 -d 4
60 rebasing 1:27547f69f254 "B" 60 rebasing 1:27547f69f254 "B"
75 Force this commit onto secret phase 75 Force this commit onto secret phase
76 76
77 $ hg phase --force --secret 6 77 $ hg phase --force --secret 6
78 78
79 $ hg tglogp 79 $ hg tglogp
80 @ 6:secret 'Extra' 80 @ 6: deb5d2f93d8b secret 'Extra'
81 | 81 |
82 | o 5:draft 'B' 82 | o 5: 45396c49d53b draft 'B'
83 | | 83 | |
84 | o 4:draft 'E' 84 | o 4: ae36e8e3dfd7 draft 'E'
85 | | 85 | |
86 | o 3:draft 'D' 86 | o 3: 46b37eabc604 draft 'D'
87 | | 87 | |
88 o | 2:draft 'C' 88 o | 2: 965c486023db draft 'C'
89 | | 89 | |
90 o | 1:draft 'B' 90 o | 1: 27547f69f254 draft 'B'
91 |/ 91 |/
92 o 0:draft 'A' 92 o 0: 4a2df7238c3b draft 'A'
93 93
94 Resume the rebasing: 94 Resume the rebasing:
95 95
96 $ hg rebase --continue 96 $ hg rebase --continue
97 already rebased 1:27547f69f254 "B" as 45396c49d53b 97 already rebased 1:27547f69f254 "B" as 45396c49d53b
113 already rebased 1:27547f69f254 "B" as 45396c49d53b 113 already rebased 1:27547f69f254 "B" as 45396c49d53b
114 rebasing 2:965c486023db "C" 114 rebasing 2:965c486023db "C"
115 warning: orphaned descendants detected, not stripping 27547f69f254, 965c486023db 115 warning: orphaned descendants detected, not stripping 27547f69f254, 965c486023db
116 116
117 $ hg tglogp 117 $ hg tglogp
118 o 7:draft 'C' 118 o 7: d2d25e26288e draft 'C'
119 | 119 |
120 | o 6:secret 'Extra' 120 | o 6: deb5d2f93d8b secret 'Extra'
121 | | 121 | |
122 o | 5:draft 'B' 122 o | 5: 45396c49d53b draft 'B'
123 | | 123 | |
124 @ | 4:draft 'E' 124 @ | 4: ae36e8e3dfd7 draft 'E'
125 | | 125 | |
126 o | 3:draft 'D' 126 o | 3: 46b37eabc604 draft 'D'
127 | | 127 | |
128 | o 2:draft 'C' 128 | o 2: 965c486023db draft 'C'
129 | | 129 | |
130 | o 1:draft 'B' 130 | o 1: 27547f69f254 draft 'B'
131 |/ 131 |/
132 o 0:draft 'A' 132 o 0: 4a2df7238c3b draft 'A'
133 133
134 $ cd .. 134 $ cd ..
135 135
136 136
137 Changes during an interruption - abort: 137 Changes during an interruption - abort:
138 138
139 $ hg clone -q -u . a a2 139 $ hg clone -q -u . a a2
140 $ cd a2 140 $ cd a2
141 141
142 $ hg tglog 142 $ hg tglog
143 @ 4: 'E' 143 @ 4: ae36e8e3dfd7 'E'
144 | 144 |
145 o 3: 'D' 145 o 3: 46b37eabc604 'D'
146 | 146 |
147 | o 2: 'C' 147 | o 2: 965c486023db 'C'
148 | | 148 | |
149 | o 1: 'B' 149 | o 1: 27547f69f254 'B'
150 |/ 150 |/
151 o 0: 'A' 151 o 0: 4a2df7238c3b 'A'
152 152
153 Rebasing B onto E: 153 Rebasing B onto E:
154 154
155 $ hg rebase -s 1 -d 4 155 $ hg rebase -s 1 -d 4
156 rebasing 1:27547f69f254 "B" 156 rebasing 1:27547f69f254 "B"
167 $ echo 'Extra' > Extra 167 $ echo 'Extra' > Extra
168 $ hg add Extra 168 $ hg add Extra
169 $ hg ci -m 'Extra' --config 'extensions.rebase=!' 169 $ hg ci -m 'Extra' --config 'extensions.rebase=!'
170 170
171 $ hg tglog 171 $ hg tglog
172 @ 6: 'Extra' 172 @ 6: 402ee3642b59 'Extra'
173 | 173 |
174 o 5: 'B' 174 o 5: 45396c49d53b 'B'
175 | 175 |
176 o 4: 'E' 176 o 4: ae36e8e3dfd7 'E'
177 | 177 |
178 o 3: 'D' 178 o 3: 46b37eabc604 'D'
179 | 179 |
180 | o 2: 'C' 180 | o 2: 965c486023db 'C'
181 | | 181 | |
182 | o 1: 'B' 182 | o 1: 27547f69f254 'B'
183 |/ 183 |/
184 o 0: 'A' 184 o 0: 4a2df7238c3b 'A'
185 185
186 Abort the rebasing: 186 Abort the rebasing:
187 187
188 $ hg rebase --abort 188 $ hg rebase --abort
189 warning: new changesets detected on destination branch, can't strip 189 warning: new changesets detected on destination branch, can't strip
190 rebase aborted 190 rebase aborted
191 191
192 $ hg tglog 192 $ hg tglog
193 @ 6: 'Extra' 193 @ 6: 402ee3642b59 'Extra'
194 | 194 |
195 o 5: 'B' 195 o 5: 45396c49d53b 'B'
196 | 196 |
197 o 4: 'E' 197 o 4: ae36e8e3dfd7 'E'
198 | 198 |
199 o 3: 'D' 199 o 3: 46b37eabc604 'D'
200 | 200 |
201 | o 2: 'C' 201 | o 2: 965c486023db 'C'
202 | | 202 | |
203 | o 1: 'B' 203 | o 1: 27547f69f254 'B'
204 |/ 204 |/
205 o 0: 'A' 205 o 0: 4a2df7238c3b 'A'
206 206
207 $ cd .. 207 $ cd ..
208 208
209 Changes during an interruption - abort (again): 209 Changes during an interruption - abort (again):
210 210
211 $ hg clone -q -u . a a3 211 $ hg clone -q -u . a a3
212 $ cd a3 212 $ cd a3
213 213
214 $ hg tglogp 214 $ hg tglogp
215 @ 4:draft 'E' 215 @ 4: ae36e8e3dfd7 draft 'E'
216 | 216 |
217 o 3:draft 'D' 217 o 3: 46b37eabc604 draft 'D'
218 | 218 |
219 | o 2:draft 'C' 219 | o 2: 965c486023db draft 'C'
220 | | 220 | |
221 | o 1:draft 'B' 221 | o 1: 27547f69f254 draft 'B'
222 |/ 222 |/
223 o 0:draft 'A' 223 o 0: 4a2df7238c3b draft 'A'
224 224
225 Rebasing B onto E: 225 Rebasing B onto E:
226 226
227 $ hg rebase -s 1 -d 4 227 $ hg rebase -s 1 -d 4
228 rebasing 1:27547f69f254 "B" 228 rebasing 1:27547f69f254 "B"
238 $ hg phase --public 1 238 $ hg phase --public 1
239 $ hg phase --public 5 239 $ hg phase --public 5
240 $ hg phase --secret -f 2 240 $ hg phase --secret -f 2
241 241
242 $ hg tglogp 242 $ hg tglogp
243 @ 5:public 'B' 243 @ 5: 45396c49d53b public 'B'
244 | 244 |
245 o 4:public 'E' 245 o 4: ae36e8e3dfd7 public 'E'
246 | 246 |
247 o 3:public 'D' 247 o 3: 46b37eabc604 public 'D'
248 | 248 |
249 | o 2:secret 'C' 249 | o 2: 965c486023db secret 'C'
250 | | 250 | |
251 | o 1:public 'B' 251 | o 1: 27547f69f254 public 'B'
252 |/ 252 |/
253 o 0:public 'A' 253 o 0: 4a2df7238c3b public 'A'
254 254
255 Abort the rebasing: 255 Abort the rebasing:
256 256
257 $ hg rebase --abort 257 $ hg rebase --abort
258 warning: can't clean up public changesets 45396c49d53b 258 warning: can't clean up public changesets 45396c49d53b
259 rebase aborted 259 rebase aborted
260 260
261 $ hg tglogp 261 $ hg tglogp
262 @ 5:public 'B' 262 @ 5: 45396c49d53b public 'B'
263 | 263 |
264 o 4:public 'E' 264 o 4: ae36e8e3dfd7 public 'E'
265 | 265 |
266 o 3:public 'D' 266 o 3: 46b37eabc604 public 'D'
267 | 267 |
268 | o 2:secret 'C' 268 | o 2: 965c486023db secret 'C'
269 | | 269 | |
270 | o 1:public 'B' 270 | o 1: 27547f69f254 public 'B'
271 |/ 271 |/
272 o 0:public 'A' 272 o 0: 4a2df7238c3b public 'A'
273 273
274 Test rebase interrupted by hooks 274 Test rebase interrupted by hooks
275 275
276 $ hg up 2 276 $ hg up 2
277 1 files updated, 0 files merged, 1 files removed, 0 files unresolved 277 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
290 M A 290 M A
291 rebasing 6:a0b2430ebfb8 "F" (tip) 291 rebasing 6:a0b2430ebfb8 "F" (tip)
292 abort: precommit hook exited with status 1 292 abort: precommit hook exited with status 1
293 [255] 293 [255]
294 $ hg tglogp 294 $ hg tglogp
295 @ 7:secret 'C' 295 @ 7: 401ccec5e39f secret 'C'
296 | 296 |
297 | @ 6:secret 'F' 297 | @ 6: a0b2430ebfb8 secret 'F'
298 | | 298 | |
299 o | 5:public 'B' 299 o | 5: 45396c49d53b public 'B'
300 | | 300 | |
301 o | 4:public 'E' 301 o | 4: ae36e8e3dfd7 public 'E'
302 | | 302 | |
303 o | 3:public 'D' 303 o | 3: 46b37eabc604 public 'D'
304 | | 304 | |
305 | o 2:secret 'C' 305 | o 2: 965c486023db secret 'C'
306 | | 306 | |
307 | o 1:public 'B' 307 | o 1: 27547f69f254 public 'B'
308 |/ 308 |/
309 o 0:public 'A' 309 o 0: 4a2df7238c3b public 'A'
310 310
311 $ hg rebase --continue 311 $ hg rebase --continue
312 already rebased 2:965c486023db "C" as 401ccec5e39f 312 already rebased 2:965c486023db "C" as 401ccec5e39f
313 rebasing 6:a0b2430ebfb8 "F" 313 rebasing 6:a0b2430ebfb8 "F"
314 saved backup bundle to $TESTTMP/hook-precommit/.hg/strip-backup/965c486023db-aa6250e7-rebase.hg (glob) 314 saved backup bundle to $TESTTMP/hook-precommit/.hg/strip-backup/965c486023db-aa6250e7-rebase.hg (glob)
315 $ hg tglogp 315 $ hg tglogp
316 @ 6:secret 'F' 316 @ 6: 6e92a149ac6b secret 'F'
317 | 317 |
318 o 5:secret 'C' 318 o 5: 401ccec5e39f secret 'C'
319 | 319 |
320 o 4:public 'B' 320 o 4: 45396c49d53b public 'B'
321 | 321 |
322 o 3:public 'E' 322 o 3: ae36e8e3dfd7 public 'E'
323 | 323 |
324 o 2:public 'D' 324 o 2: 46b37eabc604 public 'D'
325 | 325 |
326 | o 1:public 'B' 326 | o 1: 27547f69f254 public 'B'
327 |/ 327 |/
328 o 0:public 'A' 328 o 0: 4a2df7238c3b public 'A'
329 329
330 $ cd .. 330 $ cd ..
331 331
332 (pretxncommit version) 332 (pretxncommit version)
333 333
345 transaction abort! 345 transaction abort!
346 rollback completed 346 rollback completed
347 abort: pretxncommit hook exited with status 1 347 abort: pretxncommit hook exited with status 1
348 [255] 348 [255]
349 $ hg tglogp 349 $ hg tglogp
350 @ 7:secret 'C' 350 @ 7: 401ccec5e39f secret 'C'
351 | 351 |
352 | @ 6:secret 'F' 352 | @ 6: a0b2430ebfb8 secret 'F'
353 | | 353 | |
354 o | 5:public 'B' 354 o | 5: 45396c49d53b public 'B'
355 | | 355 | |
356 o | 4:public 'E' 356 o | 4: ae36e8e3dfd7 public 'E'
357 | | 357 | |
358 o | 3:public 'D' 358 o | 3: 46b37eabc604 public 'D'
359 | | 359 | |
360 | o 2:secret 'C' 360 | o 2: 965c486023db secret 'C'
361 | | 361 | |
362 | o 1:public 'B' 362 | o 1: 27547f69f254 public 'B'
363 |/ 363 |/
364 o 0:public 'A' 364 o 0: 4a2df7238c3b public 'A'
365 365
366 $ hg rebase --continue 366 $ hg rebase --continue
367 already rebased 2:965c486023db "C" as 401ccec5e39f 367 already rebased 2:965c486023db "C" as 401ccec5e39f
368 rebasing 6:a0b2430ebfb8 "F" 368 rebasing 6:a0b2430ebfb8 "F"
369 saved backup bundle to $TESTTMP/hook-pretxncommit/.hg/strip-backup/965c486023db-aa6250e7-rebase.hg (glob) 369 saved backup bundle to $TESTTMP/hook-pretxncommit/.hg/strip-backup/965c486023db-aa6250e7-rebase.hg (glob)
370 $ hg tglogp 370 $ hg tglogp
371 @ 6:secret 'F' 371 @ 6: 6e92a149ac6b secret 'F'
372 | 372 |
373 o 5:secret 'C' 373 o 5: 401ccec5e39f secret 'C'
374 | 374 |
375 o 4:public 'B' 375 o 4: 45396c49d53b public 'B'
376 | 376 |
377 o 3:public 'E' 377 o 3: ae36e8e3dfd7 public 'E'
378 | 378 |
379 o 2:public 'D' 379 o 2: 46b37eabc604 public 'D'
380 | 380 |
381 | o 1:public 'B' 381 | o 1: 27547f69f254 public 'B'
382 |/ 382 |/
383 o 0:public 'A' 383 o 0: 4a2df7238c3b public 'A'
384 384
385 $ cd .. 385 $ cd ..
386 386
387 (pretxnclose version) 387 (pretxnclose version)
388 388
395 transaction abort! 395 transaction abort!
396 rollback completed 396 rollback completed
397 abort: pretxnclose hook exited with status 1 397 abort: pretxnclose hook exited with status 1
398 [255] 398 [255]
399 $ hg tglogp 399 $ hg tglogp
400 @ 7:secret 'C' 400 @ 7: 401ccec5e39f secret 'C'
401 | 401 |
402 | @ 6:secret 'F' 402 | @ 6: a0b2430ebfb8 secret 'F'
403 | | 403 | |
404 o | 5:public 'B' 404 o | 5: 45396c49d53b public 'B'
405 | | 405 | |
406 o | 4:public 'E' 406 o | 4: ae36e8e3dfd7 public 'E'
407 | | 407 | |
408 o | 3:public 'D' 408 o | 3: 46b37eabc604 public 'D'
409 | | 409 | |
410 | o 2:secret 'C' 410 | o 2: 965c486023db secret 'C'
411 | | 411 | |
412 | o 1:public 'B' 412 | o 1: 27547f69f254 public 'B'
413 |/ 413 |/
414 o 0:public 'A' 414 o 0: 4a2df7238c3b public 'A'
415 415
416 $ hg rebase --continue 416 $ hg rebase --continue
417 already rebased 2:965c486023db "C" as 401ccec5e39f 417 already rebased 2:965c486023db "C" as 401ccec5e39f
418 rebasing 6:a0b2430ebfb8 "F" 418 rebasing 6:a0b2430ebfb8 "F"
419 saved backup bundle to $TESTTMP/hook-pretxnclose/.hg/strip-backup/965c486023db-aa6250e7-rebase.hg (glob) 419 saved backup bundle to $TESTTMP/hook-pretxnclose/.hg/strip-backup/965c486023db-aa6250e7-rebase.hg (glob)
420 $ hg tglogp 420 $ hg tglogp
421 @ 6:secret 'F' 421 @ 6: 6e92a149ac6b secret 'F'
422 | 422 |
423 o 5:secret 'C' 423 o 5: 401ccec5e39f secret 'C'
424 | 424 |
425 o 4:public 'B' 425 o 4: 45396c49d53b public 'B'
426 | 426 |
427 o 3:public 'E' 427 o 3: ae36e8e3dfd7 public 'E'
428 | 428 |
429 o 2:public 'D' 429 o 2: 46b37eabc604 public 'D'
430 | 430 |
431 | o 1:public 'B' 431 | o 1: 27547f69f254 public 'B'
432 |/ 432 |/
433 o 0:public 'A' 433 o 0: 4a2df7238c3b public 'A'
434 434
435 $ cd .. 435 $ cd ..
436 436
437 Make sure merge state is cleaned up after a no-op rebase merge (issue5494) 437 Make sure merge state is cleaned up after a no-op rebase merge (issue5494)
438 $ hg init repo 438 $ hg init repo