D6566: abort: first prototype of hg abort

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Sun Jun 30 15:08:12 EDT 2019


pulkit added inline comments.

INLINE COMMENTS

> commands.py:147
> +        if state.isunfinished(repo):
> +            abortstate = state
> +            break

`return state.abortfunc(ui, repo, **opts)` instead of storing and calling that later.

> commands.py:152
> +    if abortstate._abortfunc:
> +        return abortstate._abortfunc(ui, repo)
> +    raise error.Abort((_("%s does not support 'hg abort'") %

we should pass opts to abortfunc too. I can think of `--no-backup` as a flag which tells not to store a backup when aborting.

A nice addition will be `--dry-run` flag which tells which operation will be aborted. Also, maybe add a message saying `aborting <command>`.

> state.py:102
>                   reportonly=False, continueflag=False, stopflag=False ,
> -                 cmdmsg="", cmdhint="", statushint=""):
> +                 cmdmsg="", cmdhint="", statushint="", abortfunc=None):
>          """opname is the name the command or operation

the new argument needs documentation.

> state.py:136
>          self._continueflag = continueflag
> +        self._abortfunc = abortfunc
>  

since we will be using this argument outside of this class, let's not prepend `_` to the name.

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


More information about the Mercurial-devel mailing list