D6501: state: created new class statecheck to handle unfinishedstates

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Mon Jun 10 13:28:06 UTC 2019


martinvonz added inline comments.

INLINE COMMENTS

> state.py:106
> +        clearable boolean determines whether or not interrupted states can be
> +        cleared by running `hg update -C` which in turn deletes the state file.
> +        allowcommit boolean decides whether commit is allowed during interrupted

Nit: The `.` got lost here. Without it, `hg update -C` might also update to another commit.

> state.py:147
> +
> +    def isunfinished(self, repo, mergecheck=False):
> +        """determines whether a multi-step operation is in progress or not"""

Nit: mergecheck seems unused and it seems no callers pass in a value for it, so it could probably be removed (at least for now).

> state.py:125
> +        if not self.specialhint:
> +            if self.cmdname == 'graft':
> +                hint = _("use 'hg graft --continue' or 'hg graft --stop' to stop")

Should move the graft and update cases to where they're registered (around line 152)

> state.py:101
> +    def __init__(self, cmdname, fname, clearable=False, allowcommit=False,
> +                 specialmsg=None, specialhint=None):
> +        """cmdname is the name the command

Not: we usually don't include "special" in the names of this type of argument. A default of None often implies that it's calculated in some way if it's not provided.

> state.py:140
> +            if self.cmdname == 'update':
> +                msg = _('last update was interrupted')
> +            else:

Nit: return here and in the case below for consistency (or assign to msg also on line 145) .

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6501

To: taapas1128, durin42, martinvonz, #hg-reviewers
Cc: mjpieters, mercurial-devel


More information about the Mercurial-devel mailing list