changeset 35042:3fbc30f7b9f0

py3: handle keyword arguments in hgext/keyword.py Differential Revision: https://phab.mercurial-scm.org/D1320
author Pulkit Goyal <7895pulkit@gmail.com>
date Mon, 23 Oct 2017 00:04:30 +0530
parents 135edf120d76
children 1a07f9187831
files hgext/keyword.py
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/keyword.py	Mon Oct 23 00:04:12 2017 +0530
+++ b/hgext/keyword.py	Mon Oct 23 00:04:30 2017 +0530
@@ -104,6 +104,7 @@
     match,
     patch,
     pathutil,
+    pycompat,
     registrar,
     scmutil,
     templatefilters,
@@ -380,6 +381,7 @@
     '''Bails out if [keyword] configuration is not active.
     Returns status of working directory.'''
     if kwt:
+        opts = pycompat.byteskwargs(opts)
         return repo.status(match=scmutil.match(wctx, pats, opts), clean=True,
                            unknown=opts.get('unknown') or opts.get('all'))
     if ui.configitems('keyword'):
@@ -436,16 +438,16 @@
     ui.setconfig('keywordset', 'svn', svn, 'keyword')
 
     uikwmaps = ui.configitems('keywordmaps')
-    if args or opts.get('rcfile'):
+    if args or opts.get(r'rcfile'):
         ui.status(_('\n\tconfiguration using custom keyword template maps\n'))
         if uikwmaps:
             ui.status(_('\textending current template maps\n'))
-        if opts.get('default') or not uikwmaps:
+        if opts.get(r'default') or not uikwmaps:
             if svn:
                 ui.status(_('\toverriding default svn keywordset\n'))
             else:
                 ui.status(_('\toverriding default cvs keywordset\n'))
-        if opts.get('rcfile'):
+        if opts.get(r'rcfile'):
             ui.readconfig(opts.get('rcfile'))
         if args:
             # simulate hgrc parsing
@@ -453,7 +455,7 @@
             repo.vfs.write('hgrc', rcmaps)
             ui.readconfig(repo.vfs.join('hgrc'))
         kwmaps = dict(ui.configitems('keywordmaps'))
-    elif opts.get('default'):
+    elif opts.get(r'default'):
         if svn:
             ui.status(_('\n\tconfiguration using default svn keywordset\n'))
         else:
@@ -543,6 +545,7 @@
     else:
         cwd = ''
     files = []
+    opts = pycompat.byteskwargs(opts)
     if not opts.get('unknown') or opts.get('all'):
         files = sorted(status.modified + status.added + status.clean)
     kwfiles = kwt.iskwfile(files, wctx)