[PATCH 1 of 4] debugdirstate: convert keyword parameters to **opts

cdelahousse at fb.com cdelahousse at fb.com
Thu Nov 12 06:17:55 UTC 2015


# HG changeset patch
# User Christian Delahousse <cdelahousse at fb.com>
# Date 1447277280 28800
#      Wed Nov 11 13:28:00 2015 -0800
# Node ID 88237bdf95f715685488ba0260a27d6dd5dd5bb2
# Parent  0e3d093c468e2c168a07f2ba2b5d4d44ddd8758c
debugdirstate: convert keyword parameters to **opts

Removes the named arguments and replaces them by accessing opts. This will be
used in the next patch in the series because we'll be adding more flags to
debugdirstate

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -3162,8 +3162,12 @@
     [('', 'nodates', None, _('do not display the saved mtime')),
     ('', 'datesort', None, _('sort by saved mtime'))],
     _('[OPTION]...'))
-def debugstate(ui, repo, nodates=None, datesort=None):
+def debugstate(ui, repo, **opts):
     """show the contents of the current dirstate"""
+
+    nodates = opts.get('nodates')
+    datesort = opts.get('datesort')
+
     timestr = ""
     if datesort:
         keyfunc = lambda x: (x[1][3], x[0]) # sort by mtime, then by filename


More information about the Mercurial-devel mailing list