Patchwork D1299: py3: handle keyword arguments in hgext/churn.py

login
register
mail settings
Submitter phabricator
Date Nov. 4, 2017, 7:52 a.m.
Message ID <76ce740ece7ea2ded2d3bf1d116b7f3e@localhost.localdomain>
Download mbox | patch
Permalink /patch/25393/
State Not Applicable
Headers show

Comments

phabricator - Nov. 4, 2017, 7:52 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG26ed66ab1e72: py3: handle keyword arguments in hgext/churn.py (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1299?vs=3236&id=3274

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

AFFECTED FILES
  hgext/churn.py

CHANGE DETAILS




To: pulkit, #hg-reviewers, yuja
Cc: mercurial-devel

Patch

diff --git a/hgext/churn.py b/hgext/churn.py
--- a/hgext/churn.py
+++ b/hgext/churn.py
@@ -19,6 +19,7 @@ 
     cmdutil,
     encoding,
     patch,
+    pycompat,
     registrar,
     scmutil,
     util,
@@ -45,6 +46,7 @@ 
 
 def countrate(ui, repo, amap, *pats, **opts):
     """Calculate stats"""
+    opts = pycompat.byteskwargs(opts)
     if opts.get('dateformat'):
         def getkey(ctx):
             t, tz = ctx.date()
@@ -154,7 +156,7 @@ 
         return s + " " * (l - encoding.colwidth(s))
 
     amap = {}
-    aliases = opts.get('aliases')
+    aliases = opts.get(r'aliases')
     if not aliases and os.path.exists(repo.wjoin('.hgchurn')):
         aliases = repo.wjoin('.hgchurn')
     if aliases:
@@ -172,7 +174,7 @@ 
     if not rate:
         return
 
-    if opts.get('sort'):
+    if opts.get(r'sort'):
         rate.sort()
     else:
         rate.sort(key=lambda x: (-sum(x[1]), x))
@@ -185,7 +187,7 @@ 
     ui.debug("assuming %i character terminal\n" % ttywidth)
     width = ttywidth - maxname - 2 - 2 - 2
 
-    if opts.get('diffstat'):
+    if opts.get(r'diffstat'):
         width -= 15
         def format(name, diffstat):
             added, removed = diffstat