D6487: states: created new class to handle unified states(gsoc-19)

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Fri Jun 7 07:40:53 EDT 2019


pulkit added a comment.


  We already have mercurial/state.py and there is a cmdstate class. We can extend that class to have these variables, but for now let's move this class to that file instead of creating a new one.

INLINE COMMENTS

> statecheck.py:10
> +
> +class statecheck(object):
> +    """a utility class that will to deal with multistep operations

Nice, looks good generally. Let's add another function to class `isunfinished()` which will tell whether this operation is unfinished or not.

> statecheck.py:22
> +        """cmdname is the name the command
> +
> +        fname is the file name in which data should be stored in .hg directory.

nit: unrequired new lines between in help

> statecheck.py:48
> +                    'To abort:                      hg bisect --reset\n')
> +
> +        elif self._cmdname == 'update':

nit: remove new lines between if and else if and else

> statecheck.py:64
> +        if self._cmdname == 'update':
> +            hint = _('last update was interrupted')
> +        else:

nit: return `_('') ..` instead of creating a temp variable.

> statecheck.py:69
> +
> +    def _mergepredicate(self, repo):
> +        """determines is a merge is in progress or not"""

once we have a `isunfinished` function, this can be part of that under `if cmd == 'merge'`

REPOSITORY
  rHG Mercurial

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

To: taapas1128, #hg-reviewers
Cc: pulkit, mercurial-devel


More information about the Mercurial-devel mailing list