D2623: dispatch: adding config items for overriding flag defaults

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Sun Mar 4 09:21:48 EST 2018


yuja requested changes to this revision.
yuja added a subscriber: dploch.
yuja added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> dispatch.py:624
> +            # parse the new default as the same type as the original.
> +            newdefault = ui.configtyped("commands", cfgitem, defaulttype, olddefault)
> +            if olddefault != newdefault:

Maybe this type conversion can be a `fancyopt.customopt` method since we've
refactored the default handling by https://phab.mercurial-scm.org/D2090?

  # no idea if _defaultopt() should be made public or the whole commands.default handling
  # should be moved to fancyopts
  x = fancyopts._defaultopt(olddefault)
  newdefault = x.configdefault(ui, cmd, optname, ...)

@dploch, any suggestions?

> ui.py:390
> +                if '.default.' in k:
> +                    del cfg['commands'][k]
>          if self.plain('revsetalias'):

Perhaps this is noop since `[commands]` is removed at all if `ui.plain()` returns True.

REPOSITORY
  rHG Mercurial

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

To: rdamazio, #hg-reviewers, yuja
Cc: dploch, mercurial-devel


More information about the Mercurial-devel mailing list