Mercurial > hg
diff tests/test-graft.t @ 42582:5171937ad0f9
abort: added support for graft
This adds support of `graft` to `hg abort` plan.
The patch creates a seperate function `cmdutil.hgabortgraft`
so that abort logic for graft can be called independently.
This logic is registered to the statedetection API as `abortfunc`.
Results are shown as tests.
Differential Revision: https://phab.mercurial-scm.org/D6567
author | Taapas Agrawal <taapas2897@gmail.com> |
---|---|
date | Sun, 23 Jun 2019 22:31:31 +0530 |
parents | 12243f15d53e |
children | 2e672ccc2220 |
line wrap: on
line diff
--- a/tests/test-graft.t Sun Jun 23 20:58:01 2019 +0530 +++ b/tests/test-graft.t Sun Jun 23 22:31:31 2019 +0530 @@ -1,9 +1,18 @@ +#testcases abortcommand abortflag + $ cat >> $HGRCPATH <<EOF > [extdiff] > # for portability: > pdiff = sh "$RUNTESTDIR/pdiff" > EOF +#if abortflag + $ cat >> $HGRCPATH <<EOF + > [alias] + > abort = graft --abort + > EOF +#endif + Create a repo with some stuff in it: $ hg init a @@ -1986,8 +1995,9 @@ $ hg up 9150fe93bec6 2 files updated, 0 files merged, 0 files removed, 0 files unresolved - $ hg graft --abort - abort: no interrupted graft to abort + $ hg abort + abort: no interrupted graft to abort (abortflag !) + abort: no operation in progress (abortcommand !) [255] when stripping is required @@ -2016,7 +2026,13 @@ abort: cannot specify any other flag with '--abort' [255] - $ hg graft --abort +#if abortcommand +when in dry-run mode + $ hg abort --dry-run + graft in progress, will be aborted +#endif + + $ hg abort graft aborted working directory is now at 9150fe93bec6 $ hg log -GT "{rev}:{node|short} {desc}" @@ -2041,7 +2057,7 @@ (use 'hg resolve' and 'hg graft --continue') [255] - $ hg graft --abort + $ hg abort graft aborted working directory is now at 9150fe93bec6 $ hg log -GT "{rev}:{node|short} {desc}" @@ -2085,7 +2101,7 @@ $ hg phase -r 6 --public - $ hg graft --abort + $ hg abort cannot clean up public changesets 6ec71c037d94 graft aborted working directory is now at 6ec71c037d94 @@ -2162,7 +2178,7 @@ new changesets 311dfc6cf3bf (1 drafts) (run 'hg heads .' to see heads, 'hg merge' to merge) - $ hg graft --abort + $ hg abort new changesets detected on destination branch, can't strip graft aborted working directory is now at 6b98ff0062dd