##// END OF EJS Templates
continue: added logic for hg continue...
Taapas Agrawal -
r42831:3c16b9c0 default
parent child Browse files
Show More
@@ -1893,6 +1893,32 b' def config(ui, repo, *values, **opts):'
1893 1893 return 0
1894 1894 return 1
1895 1895
1896 @command('continue',
1897 dryrunopts, helpcategory=command.CATEGORY_CHANGE_MANAGEMENT,
1898 helpbasic=True)
1899 def continuecmd(ui, repo, **opts):
1900 """resumes an interrupted operation (EXPERIMENTAL)
1901
1902 Finishes a multistep operation like graft, histedit, rebase, merge,
1903 and unshelve if they are in an interrupted state.
1904
1905 use --dry-run/-n to dry run the command.
1906 A new operation can be added to this by registering the operation and
1907 continue logic in the unfinishedstates list under statemod.
1908 """
1909 dryrun = opts.get(r'dry_run')
1910 contstate = cmdutil.getunfinishedstate(repo)
1911 if not contstate:
1912 raise error.Abort(_('no operation in progress'))
1913 if not contstate.continuefunc:
1914 raise error.Abort((_("%s in progress but does not support "
1915 "'hg continue'") % (contstate._opname)),
1916 hint=contstate.continuemsg())
1917 if dryrun:
1918 ui.status(_('%s in progress, will be resumed\n') % (contstate._opname))
1919 return
1920 return contstate.continuefunc(ui, repo)
1921
1896 1922 @command('copy|cp',
1897 1923 [('A', 'after', None, _('record a copy that has already occurred')),
1898 1924 ('f', 'force', None, _('forcibly copy over an existing managed file')),
@@ -99,7 +99,7 b' class _statecheck(object):'
99 99
100 100 def __init__(self, opname, fname, clearable, allowcommit, reportonly,
101 101 continueflag, stopflag, cmdmsg, cmdhint, statushint,
102 abortfunc):
102 abortfunc, continuefunc):
103 103 self._opname = opname
104 104 self._fname = fname
105 105 self._clearable = clearable
@@ -111,6 +111,7 b' class _statecheck(object):'
111 111 self._cmdhint = cmdhint
112 112 self._statushint = statushint
113 113 self.abortfunc = abortfunc
114 self.continuefunc = continuefunc
114 115
115 116 def statusmsg(self):
116 117 """returns the hint message corresponding to the command for
@@ -159,7 +160,8 b' class _statecheck(object):'
159 160
160 161 def addunfinished(opname, fname, clearable=False, allowcommit=False,
161 162 reportonly=False, continueflag=False, stopflag=False,
162 cmdmsg="", cmdhint="", statushint="", abortfunc=None):
163 cmdmsg="", cmdhint="", statushint="", abortfunc=None,
164 continuefunc=None):
163 165 """this registers a new command or operation to unfinishedstates
164 166 opname is the name the command or operation
165 167 fname is the file name in which data should be stored in .hg directory.
@@ -184,10 +186,12 b' def addunfinished(opname, fname, clearab'
184 186 message of the format ('To continue: hg cmdname --continue'
185 187 'To abort: hg cmdname --abort') is not desired
186 188 abortfunc stores the function required to abort an unfinished state.
189 continuefunc stores the function required to finish an interrupted
190 operation.
187 191 """
188 192 statecheckobj = _statecheck(opname, fname, clearable, allowcommit,
189 193 reportonly, continueflag, stopflag, cmdmsg,
190 cmdhint, statushint, abortfunc)
194 cmdhint, statushint, abortfunc, continuefunc)
191 195 if opname == 'merge':
192 196 _unfinishedstates.append(statecheckobj)
193 197 else:
@@ -15,6 +15,7 b' Show all commands except debug commands'
15 15 clone
16 16 commit
17 17 config
18 continue
18 19 copy
19 20 diff
20 21 export
@@ -252,6 +253,7 b' Show all commands + options'
252 253 clone: noupdate, updaterev, rev, branch, pull, uncompressed, stream, ssh, remotecmd, insecure
253 254 commit: addremove, close-branch, amend, secret, edit, force-close-branch, interactive, include, exclude, message, logfile, date, user, subrepos
254 255 config: untrusted, edit, local, global, template
256 continue: dry-run
255 257 copy: after, force, include, exclude, dry-run
256 258 debugancestor:
257 259 debugapplystreamclonebundle:
@@ -408,6 +408,7 b' Test short command list with verbose opt'
408 408 show changeset information by line for each file
409 409 clone make a copy of an existing repository
410 410 commit, ci commit the specified files or all outstanding changes
411 continue resumes an interrupted operation (EXPERIMENTAL)
411 412 diff diff repository (or selected files)
412 413 export dump the header and diffs for one or more changesets
413 414 forget forget the specified files on the next commit
@@ -2389,6 +2390,13 b' Dish up an empty repo; serve it cold.'
2389 2390 commit the specified files or all outstanding changes
2390 2391 </td></tr>
2391 2392 <tr><td>
2393 <a href="/help/continue">
2394 continue
2395 </a>
2396 </td><td>
2397 resumes an interrupted operation (EXPERIMENTAL)
2398 </td></tr>
2399 <tr><td>
2392 2400 <a href="/help/diff">
2393 2401 diff
2394 2402 </a>
@@ -1895,6 +1895,10 b' help/ shows help topics'
1895 1895 "topic": "commit"
1896 1896 },
1897 1897 {
1898 "summary": "resumes an interrupted operation (EXPERIMENTAL)",
1899 "topic": "continue"
1900 },
1901 {
1898 1902 "summary": "diff repository (or selected files)",
1899 1903 "topic": "diff"
1900 1904 },
General Comments 0
You need to be logged in to leave comments. Login now