[PATCH 3 of 4] graphlog: pass function arguments without expansion

Yuya Nishihara yuya at tcha.org
Fri Mar 17 11:25:49 EDT 2017


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1489482973 -32400
#      Tue Mar 14 18:16:13 2017 +0900
# Node ID 9a758c848fe08e97386fca95d2428aa003939b4d
# Parent  49922515f01eae376dcc9af7b04d450d301e4782
graphlog: pass function arguments without expansion

It's annoying on Python 3 because keys must be unicode type. Let's stop using
**opts expansion when not necessary.

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -2212,7 +2212,7 @@ def displaygraph(ui, repo, dag, displaye
             graphmod.ascii(ui, state, type, char, lines, coldata)
     displayer.close()
 
-def graphlog(ui, repo, *pats, **opts):
+def graphlog(ui, repo, pats, opts):
     # Parameters are identical to log command ones
     revs, expr, filematcher = getgraphlogrevs(repo, pats, opts)
     revdag = graphmod.dagwalker(repo, revs)
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -3398,7 +3398,7 @@ def log(ui, repo, *pats, **opts):
         del opts['follow']
 
     if opts.get('graph'):
-        return cmdutil.graphlog(ui, repo, *pats, **opts)
+        return cmdutil.graphlog(ui, repo, pats, opts)
 
     revs, expr, filematcher = cmdutil.getlogrevs(repo, pats, opts)
     limit = cmdutil.loglimit(opts)


More information about the Mercurial-devel mailing list