D3300: fix: port most of the way to python 3

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Thu Apr 12 21:16:41 UTC 2018


durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Only most of the way because we now have to decide: if we want to keep
  the current .format() interface for the config in hgrc, we have to use
  unicodes to do formatting in Python 3, rather than bytes. I'm
  basically fine with that, so a follow-up patch will do so.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/fix.py

CHANGE DETAILS

diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -66,6 +66,7 @@
     mdiff,
     merge,
     obsolete,
+    pycompat,
     registrar,
     scmutil,
     util,
@@ -126,6 +127,7 @@
     revisions are not forgotten in later ones. The --base flag can be used to
     override this default behavior, though it is not usually desirable to do so.
     """
+    opts = pycompat.byteskwargs(opts)
     if opts['all']:
         if opts['rev']:
             raise error.Abort(_('cannot specify both "--rev" and "--all"'))
@@ -513,7 +515,8 @@
         result[name] = Fixer()
         attrs = ui.configsuboptions('fix', name)[1]
         for key in FIXER_ATTRS:
-            setattr(result[name], '_' + key, attrs.get(key, ''))
+            setattr(result[name], pycompat.sysstr('_' + key),
+                    attrs.get(key, ''))
     return result
 
 def fixernames(ui):



To: durin42, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list