comparison tests/test-pick.t @ 4800:fa534a8c5863

pick: added support for hg abort This patch isolates abort logic for `hg pick --abort` as `abortpick()`. For independent calls via `hg abort` `hgabortpick()` is created and registered to the state detection API. Results are shown as tests.
author Taapas Agrawal <taapas2897@gmail.com>
date Tue, 06 Aug 2019 00:16:05 +0200
parents 313565dd75e3
children 5cd7d16b8733 a9929dd36405
comparison
equal deleted inserted replaced
4799:6f9e66433ff8 4800:fa534a8c5863
1 #testcases abortcommand abortflag
1 Test for the pick command 2 Test for the pick command
2 3
3 $ cat >> $HGRCPATH <<EOF 4 $ cat >> $HGRCPATH <<EOF
4 > [alias] 5 > [alias]
5 > glog = log -G -T "{rev}:{node|short} {desc}\n" 6 > glog = log -G -T "{rev}:{node|short} {desc}\n"
6 > glf = log -GT "{rev}: {desc} ({files})\n" 7 > glf = log -GT "{rev}: {desc} ({files})\n"
7 > [extensions] 8 > [extensions]
8 > EOF 9 > EOF
9 $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH 10 $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH
10 11
12 #if abortflag
13 $ cat >> $HGRCPATH <<EOF
14 > [alias]
15 > abort = pick --abort
16 > EOF
17 #endif
18
11 $ mkcommit() { 19 $ mkcommit() {
12 > echo "$1" > "$1" 20 > echo "$1" > "$1"
13 > hg add "$1" 21 > hg add "$1"
14 > hg ci -m "add $1" 22 > hg ci -m "add $1"
15 > } 23 > }
77 Aborting without interrupted pick 85 Aborting without interrupted pick
78 86
79 $ hg pick --abort 87 $ hg pick --abort
80 abort: no interrupted pick state exists 88 abort: no interrupted pick state exists
81 [255] 89 [255]
90 #if abortcommand
91 $ hg abort
92 abort: no operation in progress
93 [255]
94 #endif
82 95
83 Specifying both continue and revs 96 Specifying both continue and revs
84 97
85 $ hg up 1f0dee641bb7 98 $ hg up 1f0dee641bb7
86 0 files updated, 0 files merged, 2 files removed, 0 files unresolved 99 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
233 merging b 246 merging b
234 warning: conflicts while merging b! (edit, then use 'hg resolve --mark') 247 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
235 unresolved merge conflicts (see hg help resolve) 248 unresolved merge conflicts (see hg help resolve)
236 [1] 249 [1]
237 250
238 $ hg pick --abort 251 #if abortcommand
252 $ hg abort --dry-run
253 pick in progress, will be aborted
254 #endif
255 $ hg abort
239 aborting pick, updating to c437988de89f 256 aborting pick, updating to c437988de89f
240 257
241 $ hg glog 258 $ hg glog
242 @ 10:c437988de89f foo to b 259 @ 10:c437988de89f foo to b
243 | 260 |