D6566: abort: added logic for of hg abort
Closed by commit rHGbb135a784b70: abort: added logic for of hg abort (authored by taapas1128). This revision was automatically updated to reflect the committed changes. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6566?vs=15836=15845 CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D6566/new/ REVISION DETAIL https://phab.mercurial-scm.org/D6566 AFFECTED FILES mercurial/commands.py mercurial/state.py tests/test-blackbox.t tests/test-completion.t tests/test-help.t tests/test-hgweb-json.t CHANGE DETAILS diff --git a/tests/test-hgweb-json.t b/tests/test-hgweb-json.t --- a/tests/test-hgweb-json.t +++ b/tests/test-hgweb-json.t @@ -1875,6 +1875,10 @@ { "earlycommands": [ { +"summary": "abort an unfinished operation (EXPERIMENTAL)", +"topic": "abort" + }, + { "summary": "add the specified files on the next commit", "topic": "add" }, diff --git a/tests/test-help.t b/tests/test-help.t --- a/tests/test-help.t +++ b/tests/test-help.t @@ -402,6 +402,7 @@ basic commands: + abort abort an unfinished operation (EXPERIMENTAL) add add the specified files on the next commit annotate, blame show changeset information by line for each file @@ -2353,6 +2354,13 @@ Main Commands + + abort + + + abort an unfinished operation (EXPERIMENTAL) + + add diff --git a/tests/test-completion.t b/tests/test-completion.t --- a/tests/test-completion.t +++ b/tests/test-completion.t @@ -1,5 +1,6 @@ Show all commands except debug commands $ hg debugcomplete + abort add addremove annotate @@ -59,6 +60,7 @@ Show all commands that start with "a" $ hg debugcomplete a + abort add addremove annotate @@ -235,6 +237,7 @@ Show all commands + options $ hg debugcommands + abort: dry-run add: include, exclude, subrepos, dry-run addremove: similarity, subrepos, include, exclude, dry-run annotate: rev, follow, no-follow, text, user, file, date, number, changeset, line-number, skip, ignore-all-space, ignore-space-change, ignore-blank-lines, ignore-space-at-eol, include, exclude, template diff --git a/tests/test-blackbox.t b/tests/test-blackbox.t --- a/tests/test-blackbox.t +++ b/tests/test-blackbox.t @@ -7,7 +7,7 @@ > @command(b'crash', [], b'hg crash') > def crash(ui, *args, **kwargs): > raise Exception("oops") - > @command(b'abort', [], b'hg abort') + > @command(b'abortcmd', [], b'hg abortcmd') > def abort(ui, *args, **kwargs): > raise error.Abort(b"oops") > EOF @@ -52,10 +52,10 @@ abort exit code $ rm ./.hg/blackbox.log - $ hg abort 2> /dev/null + $ hg abortcmd 2> /dev/null [255] $ hg blackbox -l 2 - 1970/01/01 00:00:00 bob @ (5000)> abort exited 255 after * seconds (glob) + 1970/01/01 00:00:00 bob @ (5000)> abortcmd exited 255 after * seconds (glob) 1970/01/01 00:00:00 bob @ (5000)> blackbox -l 2 unhandled exception diff --git a/mercurial/state.py b/mercurial/state.py --- a/mercurial/state.py +++ b/mercurial/state.py @@ -98,7 +98,8 @@ """ def __init__(self, opname, fname, clearable, allowcommit, reportonly, - continueflag, stopflag, cmdmsg, cmdhint, statushint): + continueflag, stopflag, cmdmsg, cmdhint, statushint, + abortfunc): self._opname = opname self._fname = fname self._clearable = clearable @@ -109,6 +110,7 @@ self._cmdmsg = cmdmsg self._cmdhint = cmdhint self._statushint = statushint +self.abortfunc = abortfunc def statusmsg(self): """returns the hint message corresponding to the command for @@ -157,7 +159,7 @@ def addunfinished(opname, fname, clearable=False, allowcommit=False, reportonly=False, continueflag=False, stopflag=False, - cmdmsg="", cmdhint="", statushint=""): + cmdmsg="", cmdhint="", statushint="", abortfunc=None): """this registers a new command or operation to unfinishedstates opname is the name the command or operation fname is the file name in which data should be stored in .hg directory. @@ -181,10 +183,11 @@ statushint is used to pass a different status message in case standard message of the format ('To continue:hg cmdname --continue' 'To abort: hg cmdname --abort') is not desired +abortfunc stores the function required to abort an unfinished state. """ statecheckobj = _statecheck(opname, fname, clearable, allowcommit, reportonly, continueflag, stopflag, cmdmsg, -cmdhint, statushint) +cmdhint, statushint, abortfunc) if opname == 'merge':
D6566: abort: added logic for of hg abort
taapas1128 marked 3 inline comments as done. taapas1128 updated this revision to Diff 15836. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6566?vs=15802=15836 CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D6566/new/ REVISION DETAIL https://phab.mercurial-scm.org/D6566 AFFECTED FILES mercurial/commands.py mercurial/state.py tests/test-blackbox.t tests/test-completion.t tests/test-help.t tests/test-hgweb-json.t CHANGE DETAILS diff --git a/tests/test-hgweb-json.t b/tests/test-hgweb-json.t --- a/tests/test-hgweb-json.t +++ b/tests/test-hgweb-json.t @@ -1875,6 +1875,10 @@ { "earlycommands": [ { +"summary": "abort an unfinished operation (EXPERIMENTAL)", +"topic": "abort" + }, + { "summary": "add the specified files on the next commit", "topic": "add" }, diff --git a/tests/test-help.t b/tests/test-help.t --- a/tests/test-help.t +++ b/tests/test-help.t @@ -402,6 +402,7 @@ basic commands: + abort abort an unfinished operation (EXPERIMENTAL) add add the specified files on the next commit annotate, blame show changeset information by line for each file @@ -2353,6 +2354,13 @@ Main Commands + + abort + + + abort an unfinished operation (EXPERIMENTAL) + + add diff --git a/tests/test-completion.t b/tests/test-completion.t --- a/tests/test-completion.t +++ b/tests/test-completion.t @@ -1,5 +1,6 @@ Show all commands except debug commands $ hg debugcomplete + abort add addremove annotate @@ -59,6 +60,7 @@ Show all commands that start with "a" $ hg debugcomplete a + abort add addremove annotate @@ -235,6 +237,7 @@ Show all commands + options $ hg debugcommands + abort: dry-run add: include, exclude, subrepos, dry-run addremove: similarity, subrepos, include, exclude, dry-run annotate: rev, follow, no-follow, text, user, file, date, number, changeset, line-number, skip, ignore-all-space, ignore-space-change, ignore-blank-lines, ignore-space-at-eol, include, exclude, template diff --git a/tests/test-blackbox.t b/tests/test-blackbox.t --- a/tests/test-blackbox.t +++ b/tests/test-blackbox.t @@ -7,7 +7,7 @@ > @command(b'crash', [], b'hg crash') > def crash(ui, *args, **kwargs): > raise Exception("oops") - > @command(b'abort', [], b'hg abort') + > @command(b'abortcmd', [], b'hg abortcmd') > def abort(ui, *args, **kwargs): > raise error.Abort(b"oops") > EOF @@ -52,10 +52,10 @@ abort exit code $ rm ./.hg/blackbox.log - $ hg abort 2> /dev/null + $ hg abortcmd 2> /dev/null [255] $ hg blackbox -l 2 - 1970/01/01 00:00:00 bob @ (5000)> abort exited 255 after * seconds (glob) + 1970/01/01 00:00:00 bob @ (5000)> abortcmd exited 255 after * seconds (glob) 1970/01/01 00:00:00 bob @ (5000)> blackbox -l 2 unhandled exception diff --git a/mercurial/state.py b/mercurial/state.py --- a/mercurial/state.py +++ b/mercurial/state.py @@ -98,7 +98,8 @@ """ def __init__(self, opname, fname, clearable, allowcommit, reportonly, - continueflag, stopflag, cmdmsg, cmdhint, statushint): + continueflag, stopflag, cmdmsg, cmdhint, statushint, + abortfunc): self._opname = opname self._fname = fname self._clearable = clearable @@ -109,6 +110,7 @@ self._cmdmsg = cmdmsg self._cmdhint = cmdhint self._statushint = statushint +self.abortfunc = abortfunc def statusmsg(self): """returns the hint message corresponding to the command for @@ -157,7 +159,7 @@ def addunfinished(opname, fname, clearable=False, allowcommit=False, reportonly=False, continueflag=False, stopflag=False, - cmdmsg="", cmdhint="", statushint=""): + cmdmsg="", cmdhint="", statushint="", abortfunc=None): """this registers a new command or operation to unfinishedstates opname is the name the command or operation fname is the file name in which data should be stored in .hg directory. @@ -181,10 +183,11 @@ statushint is used to pass a different status message in case standard message of the format ('To continue:hg cmdname --continue' 'To abort: hg cmdname --abort') is not desired +abortfunc stores the function required to abort an unfinished state. """ statecheckobj = _statecheck(opname, fname, clearable, allowcommit, reportonly, continueflag, stopflag, cmdmsg, -cmdhint, statushint) +cmdhint, statushint, abortfunc) if opname == 'merge': _unfinishedstates.append(statecheckobj) else: diff --git
D6566: abort: added logic for of hg abort
pulkit added a comment. > hg abort currently supports --dry-run/-n flag only. > It is used to dry run hg abort We should specify what does dry run does i.e. it prints the operation which will be aborted if `hg abort` is run. INLINE COMMENTS > commands.py:139 > +def abort(ui, repo, **opts): > +"""abort an unfinished operation(EXPERIMENTAL) > + You need a space between operation and (EXPERIMENTAL) > commands.py:153 > +if not abortstate.abortfunc: > +raise error.Abort((_("%s does not support 'hg abort'") % > +(abortstate._opname)), hint=abortstate.hint()) `%s is in progress but does not support 'hg abort'`. > commands.py:158 > +return > +return abortstate.abortfunc(ui, repo, **opts) > + Now that we don't have backup flag, and --dry-run is tackled before calling abortfunc, we can prevent passing `**opts`. REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D6566/new/ REVISION DETAIL https://phab.mercurial-scm.org/D6566 To: taapas1128, #hg-reviewers Cc: pulkit, martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6566: abort: added logic for of hg abort
taapas1128 edited the summary of this revision. taapas1128 updated this revision to Diff 15802. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6566?vs=15777=15802 CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D6566/new/ REVISION DETAIL https://phab.mercurial-scm.org/D6566 AFFECTED FILES mercurial/commands.py mercurial/state.py tests/test-blackbox.t tests/test-completion.t tests/test-help.t tests/test-hgweb-json.t CHANGE DETAILS diff --git a/tests/test-hgweb-json.t b/tests/test-hgweb-json.t --- a/tests/test-hgweb-json.t +++ b/tests/test-hgweb-json.t @@ -1875,6 +1875,10 @@ { "earlycommands": [ { +"summary": "abort an unfinished operation(EXPERIMENTAL)", +"topic": "abort" + }, + { "summary": "add the specified files on the next commit", "topic": "add" }, diff --git a/tests/test-help.t b/tests/test-help.t --- a/tests/test-help.t +++ b/tests/test-help.t @@ -402,6 +402,7 @@ basic commands: + abort abort an unfinished operation(EXPERIMENTAL) add add the specified files on the next commit annotate, blame show changeset information by line for each file @@ -2353,6 +2354,13 @@ Main Commands + + abort + + + abort an unfinished operation(EXPERIMENTAL) + + add diff --git a/tests/test-completion.t b/tests/test-completion.t --- a/tests/test-completion.t +++ b/tests/test-completion.t @@ -1,5 +1,6 @@ Show all commands except debug commands $ hg debugcomplete + abort add addremove annotate @@ -59,6 +60,7 @@ Show all commands that start with "a" $ hg debugcomplete a + abort add addremove annotate @@ -235,6 +237,7 @@ Show all commands + options $ hg debugcommands + abort: dry-run add: include, exclude, subrepos, dry-run addremove: similarity, subrepos, include, exclude, dry-run annotate: rev, follow, no-follow, text, user, file, date, number, changeset, line-number, skip, ignore-all-space, ignore-space-change, ignore-blank-lines, ignore-space-at-eol, include, exclude, template diff --git a/tests/test-blackbox.t b/tests/test-blackbox.t --- a/tests/test-blackbox.t +++ b/tests/test-blackbox.t @@ -7,7 +7,7 @@ > @command(b'crash', [], b'hg crash') > def crash(ui, *args, **kwargs): > raise Exception("oops") - > @command(b'abort', [], b'hg abort') + > @command(b'abortcmd', [], b'hg abortcmd') > def abort(ui, *args, **kwargs): > raise error.Abort(b"oops") > EOF @@ -52,10 +52,10 @@ abort exit code $ rm ./.hg/blackbox.log - $ hg abort 2> /dev/null + $ hg abortcmd 2> /dev/null [255] $ hg blackbox -l 2 - 1970/01/01 00:00:00 bob @ (5000)> abort exited 255 after * seconds (glob) + 1970/01/01 00:00:00 bob @ (5000)> abortcmd exited 255 after * seconds (glob) 1970/01/01 00:00:00 bob @ (5000)> blackbox -l 2 unhandled exception diff --git a/mercurial/state.py b/mercurial/state.py --- a/mercurial/state.py +++ b/mercurial/state.py @@ -98,7 +98,8 @@ """ def __init__(self, opname, fname, clearable, allowcommit, reportonly, - continueflag, stopflag, cmdmsg, cmdhint, statushint): + continueflag, stopflag, cmdmsg, cmdhint, statushint, + abortfunc): self._opname = opname self._fname = fname self._clearable = clearable @@ -109,6 +110,7 @@ self._cmdmsg = cmdmsg self._cmdhint = cmdhint self._statushint = statushint +self.abortfunc = abortfunc def statusmsg(self): """returns the hint message corresponding to the command for @@ -157,7 +159,7 @@ def addunfinished(opname, fname, clearable=False, allowcommit=False, reportonly=False, continueflag=False, stopflag=False, - cmdmsg="", cmdhint="", statushint=""): + cmdmsg="", cmdhint="", statushint="", abortfunc=None): """this registers a new command or operation to unfinishedstates opname is the name the command or operation fname is the file name in which data should be stored in .hg directory. @@ -181,10 +183,11 @@ statushint is used to pass a different status message in case standard message of the format ('To continue:hg cmdname --continue' 'To abort: hg cmdname --abort') is not desired +abortfunc stores the function required to abort an unfinished state. """ statecheckobj = _statecheck(opname, fname, clearable, allowcommit, reportonly, continueflag, stopflag, cmdmsg, -cmdhint, statushint) +cmdhint, statushint, abortfunc) if opname == 'merge': _unfinishedstates.append(statecheckobj) else: diff --git
D6566: abort: added logic for of hg abort
taapas1128 updated this revision to Diff 15777. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6566?vs=15775=15777 CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D6566/new/ REVISION DETAIL https://phab.mercurial-scm.org/D6566 AFFECTED FILES mercurial/commands.py mercurial/state.py tests/test-blackbox.t tests/test-completion.t tests/test-help.t tests/test-hgweb-json.t CHANGE DETAILS diff --git a/tests/test-hgweb-json.t b/tests/test-hgweb-json.t --- a/tests/test-hgweb-json.t +++ b/tests/test-hgweb-json.t @@ -1875,6 +1875,10 @@ { "earlycommands": [ { +"summary": "abort an unfinished operation(EXPERIMENTAL)", +"topic": "abort" + }, + { "summary": "add the specified files on the next commit", "topic": "add" }, diff --git a/tests/test-help.t b/tests/test-help.t --- a/tests/test-help.t +++ b/tests/test-help.t @@ -402,6 +402,7 @@ basic commands: + abort abort an unfinished operation(EXPERIMENTAL) add add the specified files on the next commit annotate, blame show changeset information by line for each file @@ -2353,6 +2354,13 @@ Main Commands + + abort + + + abort an unfinished operation(EXPERIMENTAL) + + add diff --git a/tests/test-completion.t b/tests/test-completion.t --- a/tests/test-completion.t +++ b/tests/test-completion.t @@ -1,5 +1,6 @@ Show all commands except debug commands $ hg debugcomplete + abort add addremove annotate @@ -59,6 +60,7 @@ Show all commands that start with "a" $ hg debugcomplete a + abort add addremove annotate @@ -235,6 +237,7 @@ Show all commands + options $ hg debugcommands + abort: no-backup, dry-run add: include, exclude, subrepos, dry-run addremove: similarity, subrepos, include, exclude, dry-run annotate: rev, follow, no-follow, text, user, file, date, number, changeset, line-number, skip, ignore-all-space, ignore-space-change, ignore-blank-lines, ignore-space-at-eol, include, exclude, template diff --git a/tests/test-blackbox.t b/tests/test-blackbox.t --- a/tests/test-blackbox.t +++ b/tests/test-blackbox.t @@ -7,7 +7,7 @@ > @command(b'crash', [], b'hg crash') > def crash(ui, *args, **kwargs): > raise Exception("oops") - > @command(b'abort', [], b'hg abort') + > @command(b'abortcmd', [], b'hg abortcmd') > def abort(ui, *args, **kwargs): > raise error.Abort(b"oops") > EOF @@ -52,10 +52,10 @@ abort exit code $ rm ./.hg/blackbox.log - $ hg abort 2> /dev/null + $ hg abortcmd 2> /dev/null [255] $ hg blackbox -l 2 - 1970/01/01 00:00:00 bob @ (5000)> abort exited 255 after * seconds (glob) + 1970/01/01 00:00:00 bob @ (5000)> abortcmd exited 255 after * seconds (glob) 1970/01/01 00:00:00 bob @ (5000)> blackbox -l 2 unhandled exception diff --git a/mercurial/state.py b/mercurial/state.py --- a/mercurial/state.py +++ b/mercurial/state.py @@ -98,7 +98,8 @@ """ def __init__(self, opname, fname, clearable, allowcommit, reportonly, - continueflag, stopflag, cmdmsg, cmdhint, statushint): + continueflag, stopflag, cmdmsg, cmdhint, statushint, + abortfunc): self._opname = opname self._fname = fname self._clearable = clearable @@ -109,6 +110,7 @@ self._cmdmsg = cmdmsg self._cmdhint = cmdhint self._statushint = statushint +self.abortfunc = abortfunc def statusmsg(self): """returns the hint message corresponding to the command for @@ -157,7 +159,7 @@ def addunfinished(opname, fname, clearable=False, allowcommit=False, reportonly=False, continueflag=False, stopflag=False, - cmdmsg="", cmdhint="", statushint=""): + cmdmsg="", cmdhint="", statushint="", abortfunc=None): """this registers a new command or operation to unfinishedstates opname is the name the command or operation fname is the file name in which data should be stored in .hg directory. @@ -181,10 +183,11 @@ statushint is used to pass a different status message in case standard message of the format ('To continue:hg cmdname --continue' 'To abort: hg cmdname --abort') is not desired +abortfunc stores the function required to abort an unfinished state. """ statecheckobj = _statecheck(opname, fname, clearable, allowcommit, reportonly, continueflag, stopflag, cmdmsg, -cmdhint, statushint) +cmdhint, statushint, abortfunc) if opname == 'merge': _unfinishedstates.append(statecheckobj) else: diff --git a/mercurial/commands.py
D6566: abort: added logic for of hg abort
pulkit added inline comments. INLINE COMMENTS > commands.py:135 > > +@command('abort', > +[('', 'no-backup', False, _('do not save backup copies of files')), Can you mark this command as experimental for now, we will be close to release soon. Marking this as experimental will help us take more time to smoothen things out. > commands.py:136 > +@command('abort', > +[('', 'no-backup', False, _('do not save backup copies of files')), > +] + dryrunopts, helpcategory=command.CATEGORY_CHANGE_MANAGEMENT, This help should be `'do not save backup bundle'` as similar to strip command. > commands.py:142 > + > +Aborts an multistep operation like graft, histedit, rebase, merge, > +and unshelve if they are in an unfinished state. s/an/a > commands.py:154 > +abortstate = None > +dryrun = opts.get('dry_run') > +for state in statemod._unfinishedstates: need to prepend `r''` in front of dry_run for py3 compat. > commands.py:165 > +if dryrun: > +ui.status(_('aborting %s\n') % (abortstate._opname)) > +return abortstate.abortfunc(ui, repo, **opts) we should return here so that `abortstate.abortfunc()` is not called below in case of dry-run. REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D6566/new/ REVISION DETAIL https://phab.mercurial-scm.org/D6566 To: taapas1128, #hg-reviewers Cc: pulkit, martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6566: abort: added logic for of hg abort
taapas1128 updated this revision to Diff 15775. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6566?vs=15750=15775 CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D6566/new/ REVISION DETAIL https://phab.mercurial-scm.org/D6566 AFFECTED FILES mercurial/commands.py mercurial/state.py tests/test-blackbox.t tests/test-commandserver.t tests/test-completion.t tests/test-globalopts.t tests/test-help-hide.t tests/test-help.t tests/test-hgweb-json.t CHANGE DETAILS diff --git a/tests/test-hgweb-json.t b/tests/test-hgweb-json.t --- a/tests/test-hgweb-json.t +++ b/tests/test-hgweb-json.t @@ -1875,6 +1875,10 @@ { "earlycommands": [ { +"summary": "abort an unfinished operation", +"topic": "abort" + }, + { "summary": "add the specified files on the next commit", "topic": "add" }, diff --git a/tests/test-help.t b/tests/test-help.t --- a/tests/test-help.t +++ b/tests/test-help.t @@ -5,6 +5,7 @@ basic commands: + abort abort an unfinished operation add add the specified files on the next commit annotate show changeset information by line for each file clone make a copy of an existing repository @@ -26,6 +27,7 @@ (use 'hg help' for the full list of commands or 'hg -v' for details) $ hg -q + abort abort an unfinished operation add add the specified files on the next commit annotate show changeset information by line for each file clone make a copy of an existing repository @@ -73,6 +75,7 @@ Change manipulation: + abort abort an unfinished operation backout reverse effect of earlier changeset graft copy changes from other branches onto the current branch merge merge another revision into working directory @@ -201,6 +204,7 @@ Change manipulation: + abort abort an unfinished operation backout reverse effect of earlier changeset graft copy changes from other branches onto the current branch merge merge another revision into working directory @@ -402,6 +406,7 @@ basic commands: + abort abort an unfinished operation add add the specified files on the next commit annotate, blame show changeset information by line for each file @@ -2353,6 +2358,13 @@ Main Commands + + abort + + + abort an unfinished operation + + add diff --git a/tests/test-help-hide.t b/tests/test-help-hide.t --- a/tests/test-help-hide.t +++ b/tests/test-help-hide.t @@ -21,6 +21,7 @@ Change manipulation: + abort abort an unfinished operation backout reverse effect of earlier changeset graft copy changes from other branches onto the current branch merge merge another revision into working directory @@ -157,6 +158,7 @@ Change manipulation: + abort abort an unfinished operation backout reverse effect of earlier changeset graft copy changes from other branches onto the current branch merge merge another revision into working directory diff --git a/tests/test-globalopts.t b/tests/test-globalopts.t --- a/tests/test-globalopts.t +++ b/tests/test-globalopts.t @@ -317,6 +317,7 @@ Change manipulation: + abort abort an unfinished operation backout reverse effect of earlier changeset graft copy changes from other branches onto the current branch merge merge another revision into working directory @@ -449,6 +450,7 @@ Change manipulation: + abort abort an unfinished operation backout reverse effect of earlier changeset graft copy changes from other branches onto the current branch merge merge another revision into working directory diff --git a/tests/test-completion.t b/tests/test-completion.t --- a/tests/test-completion.t +++ b/tests/test-completion.t @@ -1,5 +1,6 @@ Show all commands except debug commands $ hg debugcomplete + abort add addremove annotate @@ -59,6 +60,7 @@ Show all commands that start with "a" $ hg debugcomplete a + abort add addremove annotate @@ -235,6 +237,7 @@ Show all commands + options $ hg debugcommands + abort: no-backup, dry-run add: include, exclude, subrepos, dry-run addremove: similarity, subrepos, include, exclude, dry-run annotate: rev, follow, no-follow, text, user, file, date, number, changeset, line-number, skip, ignore-all-space, ignore-space-change, ignore-blank-lines, ignore-space-at-eol, include, exclude, template diff --git a/tests/test-commandserver.t b/tests/test-commandserver.t --- a/tests/test-commandserver.t +++ b/tests/test-commandserver.t @@ -62,6 +62,7 @@ basic commands: + abort abort an unfinished
D6566: abort: added logic for of hg abort
taapas1128 edited the summary of this revision. taapas1128 retitled this revision from "abort: first prototype of hg abort" to "abort: added logic for of hg abort". taapas1128 updated this revision to Diff 15750. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6566?vs=15731=15750 CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D6566/new/ REVISION DETAIL https://phab.mercurial-scm.org/D6566 AFFECTED FILES mercurial/commands.py mercurial/state.py tests/test-commandserver.t tests/test-completion.t tests/test-globalopts.t tests/test-help-hide.t tests/test-help.t tests/test-hgweb-json.t CHANGE DETAILS diff --git a/tests/test-hgweb-json.t b/tests/test-hgweb-json.t --- a/tests/test-hgweb-json.t +++ b/tests/test-hgweb-json.t @@ -1875,6 +1875,10 @@ { "earlycommands": [ { +"summary": "abort an unfinished operation", +"topic": "abort" + }, + { "summary": "add the specified files on the next commit", "topic": "add" }, diff --git a/tests/test-help.t b/tests/test-help.t --- a/tests/test-help.t +++ b/tests/test-help.t @@ -5,6 +5,7 @@ basic commands: + abort abort an unfinished operation add add the specified files on the next commit annotate show changeset information by line for each file clone make a copy of an existing repository @@ -26,6 +27,7 @@ (use 'hg help' for the full list of commands or 'hg -v' for details) $ hg -q + abort abort an unfinished operation add add the specified files on the next commit annotate show changeset information by line for each file clone make a copy of an existing repository @@ -73,6 +75,7 @@ Change manipulation: + abort abort an unfinished operation backout reverse effect of earlier changeset graft copy changes from other branches onto the current branch merge merge another revision into working directory @@ -201,6 +204,7 @@ Change manipulation: + abort abort an unfinished operation backout reverse effect of earlier changeset graft copy changes from other branches onto the current branch merge merge another revision into working directory @@ -402,6 +406,7 @@ basic commands: + abort abort an unfinished operation add add the specified files on the next commit annotate, blame show changeset information by line for each file @@ -2353,6 +2358,13 @@ Main Commands + + abort + + + abort an unfinished operation + + add diff --git a/tests/test-help-hide.t b/tests/test-help-hide.t --- a/tests/test-help-hide.t +++ b/tests/test-help-hide.t @@ -21,6 +21,7 @@ Change manipulation: + abort abort an unfinished operation backout reverse effect of earlier changeset graft copy changes from other branches onto the current branch merge merge another revision into working directory @@ -157,6 +158,7 @@ Change manipulation: + abort abort an unfinished operation backout reverse effect of earlier changeset graft copy changes from other branches onto the current branch merge merge another revision into working directory diff --git a/tests/test-globalopts.t b/tests/test-globalopts.t --- a/tests/test-globalopts.t +++ b/tests/test-globalopts.t @@ -317,6 +317,7 @@ Change manipulation: + abort abort an unfinished operation backout reverse effect of earlier changeset graft copy changes from other branches onto the current branch merge merge another revision into working directory @@ -449,6 +450,7 @@ Change manipulation: + abort abort an unfinished operation backout reverse effect of earlier changeset graft copy changes from other branches onto the current branch merge merge another revision into working directory diff --git a/tests/test-completion.t b/tests/test-completion.t --- a/tests/test-completion.t +++ b/tests/test-completion.t @@ -1,5 +1,6 @@ Show all commands except debug commands $ hg debugcomplete + abort add addremove annotate @@ -59,6 +60,7 @@ Show all commands that start with "a" $ hg debugcomplete a + abort add addremove annotate @@ -235,6 +237,7 @@ Show all commands + options $ hg debugcommands + abort: no-backup, dry-run add: include, exclude, subrepos, dry-run addremove: similarity, subrepos, include, exclude, dry-run annotate: rev, follow, no-follow, text, user, file, date, number, changeset, line-number, skip, ignore-all-space, ignore-space-change, ignore-blank-lines, ignore-space-at-eol, include, exclude, template diff --git a/tests/test-commandserver.t b/tests/test-commandserver.t ---
D6566: abort: added logic for of hg abort
pulkit added inline comments. INLINE COMMENTS > commands.py:166 > + > +if nobackup: > +arglist = inspect.getargspec(abortstate.abortfunc)[0] Arguments for abort can increase in future. Rather pass the opts directly to abort functions for now and make related functions look for flag which they need. I agree it's not nice, but seems like a good tradeoff to start and have better code. > commands.py:173 > +if dryrun: > +raise error.Abort(_('aborting %s') % (abortstate._opname)) > + should be `ui.status()` instead of `error.Abort()` REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D6566/new/ REVISION DETAIL https://phab.mercurial-scm.org/D6566 To: taapas1128, #hg-reviewers Cc: pulkit, martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6566: abort: added logic for of hg abort
taapas1128 updated this revision to Diff 15731. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6566?vs=15646=15750 CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D6566/new/ REVISION DETAIL https://phab.mercurial-scm.org/D6566 AFFECTED FILES mercurial/commands.py mercurial/state.py tests/test-commandserver.t tests/test-completion.t tests/test-globalopts.t tests/test-help-hide.t tests/test-help.t tests/test-hgweb-json.t CHANGE DETAILS diff --git a/tests/test-hgweb-json.t b/tests/test-hgweb-json.t --- a/tests/test-hgweb-json.t +++ b/tests/test-hgweb-json.t @@ -1875,6 +1875,10 @@ { "earlycommands": [ { +"summary": "abort an unfinished operation", +"topic": "abort" + }, + { "summary": "add the specified files on the next commit", "topic": "add" }, diff --git a/tests/test-help.t b/tests/test-help.t --- a/tests/test-help.t +++ b/tests/test-help.t @@ -5,6 +5,7 @@ basic commands: + abort abort an unfinished operation add add the specified files on the next commit annotate show changeset information by line for each file clone make a copy of an existing repository @@ -26,6 +27,7 @@ (use 'hg help' for the full list of commands or 'hg -v' for details) $ hg -q + abort abort an unfinished operation add add the specified files on the next commit annotate show changeset information by line for each file clone make a copy of an existing repository @@ -73,6 +75,7 @@ Change manipulation: + abort abort an unfinished operation backout reverse effect of earlier changeset graft copy changes from other branches onto the current branch merge merge another revision into working directory @@ -201,6 +204,7 @@ Change manipulation: + abort abort an unfinished operation backout reverse effect of earlier changeset graft copy changes from other branches onto the current branch merge merge another revision into working directory @@ -402,6 +406,7 @@ basic commands: + abort abort an unfinished operation add add the specified files on the next commit annotate, blame show changeset information by line for each file @@ -2353,6 +2358,13 @@ Main Commands + + abort + + + abort an unfinished operation + + add diff --git a/tests/test-help-hide.t b/tests/test-help-hide.t --- a/tests/test-help-hide.t +++ b/tests/test-help-hide.t @@ -21,6 +21,7 @@ Change manipulation: + abort abort an unfinished operation backout reverse effect of earlier changeset graft copy changes from other branches onto the current branch merge merge another revision into working directory @@ -157,6 +158,7 @@ Change manipulation: + abort abort an unfinished operation backout reverse effect of earlier changeset graft copy changes from other branches onto the current branch merge merge another revision into working directory diff --git a/tests/test-globalopts.t b/tests/test-globalopts.t --- a/tests/test-globalopts.t +++ b/tests/test-globalopts.t @@ -317,6 +317,7 @@ Change manipulation: + abort abort an unfinished operation backout reverse effect of earlier changeset graft copy changes from other branches onto the current branch merge merge another revision into working directory @@ -449,6 +450,7 @@ Change manipulation: + abort abort an unfinished operation backout reverse effect of earlier changeset graft copy changes from other branches onto the current branch merge merge another revision into working directory diff --git a/tests/test-completion.t b/tests/test-completion.t --- a/tests/test-completion.t +++ b/tests/test-completion.t @@ -1,5 +1,6 @@ Show all commands except debug commands $ hg debugcomplete + abort add addremove annotate @@ -59,6 +60,7 @@ Show all commands that start with "a" $ hg debugcomplete a + abort add addremove annotate @@ -235,6 +237,7 @@ Show all commands + options $ hg debugcommands + abort: no-backup, dry-run add: include, exclude, subrepos, dry-run addremove: similarity, subrepos, include, exclude, dry-run annotate: rev, follow, no-follow, text, user, file, date, number, changeset, line-number, skip, ignore-all-space, ignore-space-change, ignore-blank-lines, ignore-space-at-eol, include, exclude, template diff --git a/tests/test-commandserver.t b/tests/test-commandserver.t --- a/tests/test-commandserver.t +++ b/tests/test-commandserver.t @@ -62,6 +62,7 @@ basic commands: + abort abort an unfinished operation add