##// END OF EJS Templates
abort: added support for graft...
Taapas Agrawal -
r42785:5171937a default
parent child Browse files
Show More
@@ -3419,3 +3419,9 b' def readgraftstate(repo, graftstate):'
3419 3419 except error.CorruptedState:
3420 3420 nodes = repo.vfs.read('graftstate').splitlines()
3421 3421 return {'nodes': nodes}
3422
3423 def hgabortgraft(ui, repo):
3424 """ abort logic for aborting graft using 'hg abort'"""
3425 with repo.wlock():
3426 graftstate = statemod.cmdstate(repo, 'graftstate')
3427 return abortgraft(ui, repo, graftstate)
@@ -2677,6 +2677,12 b' def _stopgraft(ui, repo, graftstate):'
2677 2677 ui.status(_("working directory is now at %s\n") % pctx.hex()[:12])
2678 2678 return 0
2679 2679
2680 statemod.addunfinished(
2681 'graft', fname='graftstate', clearable=True, stopflag=True,
2682 continueflag=True, abortfunc=cmdutil.hgabortgraft,
2683 cmdhint=_("use 'hg graft --continue' or 'hg graft --stop' to stop")
2684 )
2685
2680 2686 @command('grep',
2681 2687 [('0', 'print0', None, _('end fields with NUL')),
2682 2688 ('', 'all', None, _('print all revisions that match (DEPRECATED) ')),
@@ -194,11 +194,6 b' def addunfinished(opname, fname, clearab'
194 194 _unfinishedstates.insert(0, statecheckobj)
195 195
196 196 addunfinished(
197 'graft', fname='graftstate', clearable=True, stopflag=True,
198 continueflag=True,
199 cmdhint=_("use 'hg graft --continue' or 'hg graft --stop' to stop")
200 )
201 addunfinished(
202 197 'unshelve', fname='shelvedstate', continueflag=True,
203 198 cmdmsg=_('unshelve already in progress')
204 199 )
@@ -1,9 +1,18 b''
1 #testcases abortcommand abortflag
2
1 3 $ cat >> $HGRCPATH <<EOF
2 4 > [extdiff]
3 5 > # for portability:
4 6 > pdiff = sh "$RUNTESTDIR/pdiff"
5 7 > EOF
6 8
9 #if abortflag
10 $ cat >> $HGRCPATH <<EOF
11 > [alias]
12 > abort = graft --abort
13 > EOF
14 #endif
15
7 16 Create a repo with some stuff in it:
8 17
9 18 $ hg init a
@@ -1986,8 +1995,9 b' before the graft'
1986 1995 $ hg up 9150fe93bec6
1987 1996 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1988 1997
1989 $ hg graft --abort
1990 abort: no interrupted graft to abort
1998 $ hg abort
1999 abort: no interrupted graft to abort (abortflag !)
2000 abort: no operation in progress (abortcommand !)
1991 2001 [255]
1992 2002
1993 2003 when stripping is required
@@ -2016,7 +2026,13 b' when stripping is required'
2016 2026 abort: cannot specify any other flag with '--abort'
2017 2027 [255]
2018 2028
2019 $ hg graft --abort
2029 #if abortcommand
2030 when in dry-run mode
2031 $ hg abort --dry-run
2032 graft in progress, will be aborted
2033 #endif
2034
2035 $ hg abort
2020 2036 graft aborted
2021 2037 working directory is now at 9150fe93bec6
2022 2038 $ hg log -GT "{rev}:{node|short} {desc}"
@@ -2041,7 +2057,7 b' when stripping is not required'
2041 2057 (use 'hg resolve' and 'hg graft --continue')
2042 2058 [255]
2043 2059
2044 $ hg graft --abort
2060 $ hg abort
2045 2061 graft aborted
2046 2062 working directory is now at 9150fe93bec6
2047 2063 $ hg log -GT "{rev}:{node|short} {desc}"
@@ -2085,7 +2101,7 b' when some of the changesets became publi'
2085 2101
2086 2102 $ hg phase -r 6 --public
2087 2103
2088 $ hg graft --abort
2104 $ hg abort
2089 2105 cannot clean up public changesets 6ec71c037d94
2090 2106 graft aborted
2091 2107 working directory is now at 6ec71c037d94
@@ -2162,7 +2178,7 b' when we created new changesets on top of'
2162 2178 new changesets 311dfc6cf3bf (1 drafts)
2163 2179 (run 'hg heads .' to see heads, 'hg merge' to merge)
2164 2180
2165 $ hg graft --abort
2181 $ hg abort
2166 2182 new changesets detected on destination branch, can't strip
2167 2183 graft aborted
2168 2184 working directory is now at 6b98ff0062dd
General Comments 0
You need to be logged in to leave comments. Login now