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

login
register
mail settings
Submitter Yuya Nishihara
Date March 17, 2017, 3:25 p.m.
Message ID <9a758c848fe08e97386f.1489764349@mimosa>
Download mbox | patch
Permalink /patch/19422/
State Accepted
Headers show

Comments

Yuya Nishihara - March 17, 2017, 3:25 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@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.

Patch

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)