Mercurial > hg
diff mercurial/debugcommands.py @ 39760:7e99b02768ef
debugdirstate: deprecate --nodates in favor of --no-dates
We have supported 'no-' prefixes for boolean flag for a few years now,
so I was expecting it to be --no-dates.
I noticed that we have --nodates options for a few more commands
(e.g. `hg diff`), but I'll leave that for another day.
Differential Revision: https://phab.mercurial-scm.org/D4693
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 20 Sep 2018 21:35:01 -0700 |
parents | d06834e0f48e |
children | 24e493ec2229 |
line wrap: on
line diff
--- a/mercurial/debugcommands.py Fri Sep 21 00:37:03 2018 -0400 +++ b/mercurial/debugcommands.py Thu Sep 20 21:35:01 2018 -0700 @@ -733,13 +733,16 @@ fm.end() @command('debugdirstate|debugstate', - [('', 'nodates', None, _('do not display the saved mtime')), - ('', 'datesort', None, _('sort by saved mtime'))], + [('', 'nodates', None, _('do not display the saved mtime (DEPRECATED)')), + ('', 'dates', True, _('display the saved mtime')), + ('', 'datesort', None, _('sort by saved mtime'))], _('[OPTION]...')) def debugstate(ui, repo, **opts): """show the contents of the current dirstate""" - nodates = opts.get(r'nodates') + nodates = not opts[r'dates'] + if opts.get(r'nodates') is not None: + nodates = True datesort = opts.get(r'datesort') timestr = ""