comparison tests/test-evolve-abort-orphan.t @ 4798:2e14a9386316

abort: added support for evolve to hg abort This patch adds support of `hg evolve --abort` to `hg abort` plan. This involves creating a `hgabortevolve()` function under `evolvecmd` which ensures abortion of evolve via `hg abort`. This function is then registered using `addunfinished()` in `__init__.py`. Results are shown as tests.
author Taapas Agrawal <taapas2897@gmail.com>
date Thu, 11 Jul 2019 22:56:46 +0530
parents 36c2bac8cab3
children 5cd7d16b8733 b2de5825e5ca
comparison
equal deleted inserted replaced
4797:8c780c3eb116 4798:2e14a9386316
8 This test contains cases when `hg evolve` is doing orphan resolution. 8 This test contains cases when `hg evolve` is doing orphan resolution.
9 9
10 Setup 10 Setup
11 ===== 11 =====
12 12
13 #testcases abortcommand abortflag
13 $ cat >> $HGRCPATH <<EOF 14 $ cat >> $HGRCPATH <<EOF
14 > [phases] 15 > [phases]
15 > publish = False 16 > publish = False
16 > [alias] 17 > [alias]
17 > glog = log -GT "{rev}:{node|short} {desc}\n ({bookmarks}) {phase}" 18 > glog = log -GT "{rev}:{node|short} {desc}\n ({bookmarks}) {phase}"
18 > [extensions] 19 > [extensions]
19 > EOF 20 > EOF
20 $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH 21 $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH
21 22
23 #if abortflag
24 $ cat >> $HGRCPATH <<EOF
25 > [alias]
26 > abort = evolve --abort
27 > EOF
28 #endif
29
22 $ hg init abortrepo 30 $ hg init abortrepo
23 $ cd abortrepo 31 $ cd abortrepo
24 $ echo ".*\.orig" > .hgignore 32 $ echo ".*\.orig" > .hgignore
25 $ hg add .hgignore 33 $ hg add .hgignore
26 $ hg ci -m "added hgignore" 34 $ hg ci -m "added hgignore"
39 () draft 47 () draft
40 48
41 Testing --abort when no evolve is interrupted 49 Testing --abort when no evolve is interrupted
42 ============================================= 50 =============================================
43 51
52 #if abortflag
44 $ hg evolve --abort 53 $ hg evolve --abort
45 abort: no interrupted evolve to abort 54 abort: no interrupted evolve to abort
46 [255] 55 [255]
56 #else
57 $ hg abort
58 abort: no operation in progress
59 [255]
60 #endif
47 61
48 Testing with wrong combination of flags 62 Testing with wrong combination of flags
49 ======================================= 63 =======================================
50 64
51 $ hg evolve --abort --continue 65 $ hg evolve --abort --continue
101 user: test 115 user: test
102 date: Thu Jan 01 00:00:00 1970 +0000 116 date: Thu Jan 01 00:00:00 1970 +0000
103 instability: orphan 117 instability: orphan
104 summary: added d 118 summary: added d
105 119
106 120 #if abortcommand
107 $ hg evolve --abort 121 when in dry-run mode
122 $ hg abort --dry-run
123 evolve in progress, will be aborted
124 #endif
125
126 $ hg abort
108 evolve aborted 127 evolve aborted
109 working directory is now at e93a9161a274 128 working directory is now at e93a9161a274
110 129
111 $ hg glog 130 $ hg glog
112 @ 5:e93a9161a274 added c 131 @ 5:e93a9161a274 added c
197 | x 1:c7586e2a9264 added a 216 | x 1:c7586e2a9264 added a
198 |/ () draft 217 |/ () draft
199 o 0:8fa14d15e168 added hgignore 218 o 0:8fa14d15e168 added hgignore
200 () draft 219 () draft
201 220
202 $ hg evolve --abort 221 $ hg abort
203 1 new orphan changesets 222 1 new orphan changesets
204 evolve aborted 223 evolve aborted
205 working directory is now at 125af0ed8cae 224 working directory is now at 125af0ed8cae
206 225
207 $ hg glog 226 $ hg glog
297 | x 1:2f913b0c9220 added a 316 | x 1:2f913b0c9220 added a
298 |/ () draft 317 |/ () draft
299 o 0:8fa14d15e168 added hgignore 318 o 0:8fa14d15e168 added hgignore
300 () draft 319 () draft
301 320
302 $ hg evolve --abort 321 $ hg abort
303 2 new orphan changesets 322 2 new orphan changesets
304 evolve aborted 323 evolve aborted
305 working directory is now at 807e8e2ca559 324 working directory is now at 807e8e2ca559
306 325
307 $ hg glog 326 $ hg glog
393 adding changesets 412 adding changesets
394 adding manifests 413 adding manifests
395 adding file changes 414 adding file changes
396 added 1 changesets with 1 changes to 1 files 415 added 1 changesets with 1 changes to 1 files
397 $ cd ../repotwo 416 $ cd ../repotwo
398 $ hg evolve --abort 417 $ hg abort
399 warning: new changesets detected on destination branch 418 warning: new changesets detected on destination branch
400 abort: unable to abort interrupted evolve, use 'hg evolve --stop' to stop evolve 419 abort: unable to abort interrupted evolve, use 'hg evolve --stop' to stop evolve
401 [255] 420 [255]
402 421
403 $ hg evolve --stop 422 $ hg evolve --stop
440 o 0:8fa14d15e168 added hgignore 459 o 0:8fa14d15e168 added hgignore
441 () draft 460 () draft
442 461
443 $ hg phase -r 1c476940790a --public 462 $ hg phase -r 1c476940790a --public
444 463
445 $ hg evolve --abort 464 $ hg abort
446 cannot clean up public changesets: 1c476940790a 465 cannot clean up public changesets: 1c476940790a
447 abort: unable to abort interrupted evolve, use 'hg evolve --stop' to stop evolve 466 abort: unable to abort interrupted evolve, use 'hg evolve --stop' to stop evolve
448 [255] 467 [255]
449 468
450 $ hg evolve --stop 469 $ hg evolve --stop
508 | x 1:2f913b0c9220 added a 527 | x 1:2f913b0c9220 added a
509 |/ () draft 528 |/ () draft
510 o 0:8fa14d15e168 added hgignore 529 o 0:8fa14d15e168 added hgignore
511 () draft 530 () draft
512 531
513 $ hg evolve --abort 532 $ hg abort
514 1 new orphan changesets 533 1 new orphan changesets
515 evolve aborted 534 evolve aborted
516 working directory is now at a0086c17bfc7 535 working directory is now at a0086c17bfc7
517 536
518 $ hg glog 537 $ hg glog
541 warning: conflicts while merging c! (edit, then use 'hg resolve --mark') 560 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
542 unresolved merge conflicts 561 unresolved merge conflicts
543 (see 'hg help evolve.interrupted') 562 (see 'hg help evolve.interrupted')
544 [1] 563 [1]
545 564
546 $ hg evolve --abort 565 $ hg abort
547 evolve aborted 566 evolve aborted
548 working directory is now at c1f4718020e3 567 working directory is now at c1f4718020e3
549 568
550 $ ls .hg/ 569 $ ls .hg/
551 00changelog.i 570 00changelog.i