D3669: cmdutil: have statefile names in STATES instead of functions

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Sun Jul 1 21:27:50 UTC 2018


pulkit added inline comments.

INLINE COMMENTS

> martinvonz wrote in cmdutil.py:3210
> It's a bit more complicated, I agree, but I think it's better than the alternative. If it removes the need for clearable, it's not that much more complicated.
> 
> An alternative would be to create an object with [is]dirty(), allowcommit(), and clear() methods and have a function that creates such an object for file-based states (all but .hg/merge?). That would reduce the duplication of fileexistspredicate(<name>) and clearfunction(<name>).
> 
> PS. Sorry about the delay. I've been away.

(Sorry, I missed this one too. I have turned off personal emails from phabricator and use mercurial-devel to keep track of people replying to me.)

The object sounds good API. I will try that.

REPOSITORY
  rHG Mercurial

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

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


More information about the Mercurial-devel mailing list