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