diff hgext/automv.py @ 43077:687b865b95ad

formatting: byteify all mercurial/ and hgext/ string literals Done with python3.7 contrib/byteify-strings.py -i $(hg files 'set:mercurial/**.py - mercurial/thirdparty/** + hgext/**.py - hgext/fsmonitor/pywatchman/** - mercurial/__init__.py') black -l 80 -t py33 -S $(hg files 'set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**" - hgext/fsmonitor/pywatchman/**') # skip-blame mass-reformatting only Differential Revision: https://phab.mercurial-scm.org/D6972
author Augie Fackler <augie@google.com>
date Sun, 06 Oct 2019 09:48:39 -0400
parents 2372284d9457
children 89a2afe31e82
line wrap: on
line diff
--- a/hgext/automv.py	Sun Oct 06 09:45:02 2019 -0400
+++ b/hgext/automv.py	Sun Oct 06 09:48:39 2019 -0400
@@ -42,14 +42,14 @@
 configitem = registrar.configitem(configtable)
 
 configitem(
-    'automv', 'similarity', default=95,
+    b'automv', b'similarity', default=95,
 )
 
 
 def extsetup(ui):
-    entry = extensions.wrapcommand(commands.table, 'commit', mvcheck)
+    entry = extensions.wrapcommand(commands.table, b'commit', mvcheck)
     entry[1].append(
-        ('', 'no-automv', None, _('disable automatic file move detection'))
+        (b'', b'no-automv', None, _(b'disable automatic file move detection'))
     )
 
 
@@ -57,11 +57,11 @@
     """Hook to check for moves at commit time"""
     opts = pycompat.byteskwargs(opts)
     renames = None
-    disabled = opts.pop('no_automv', False)
+    disabled = opts.pop(b'no_automv', False)
     if not disabled:
-        threshold = ui.configint('automv', 'similarity')
+        threshold = ui.configint(b'automv', b'similarity')
         if not 0 <= threshold <= 100:
-            raise error.Abort(_('automv.similarity must be between 0 and 100'))
+            raise error.Abort(_(b'automv.similarity must be between 0 and 100'))
         if threshold > 0:
             match = scmutil.match(repo[None], pats, opts)
             added, removed = _interestingfiles(repo, match)
@@ -87,7 +87,7 @@
     added = stat.added
     removed = stat.removed
 
-    copy = copies.pathcopies(repo['.'], repo[None], matcher)
+    copy = copies.pathcopies(repo[b'.'], repo[None], matcher)
     # remove the copy files for which we already have copy info
     added = [f for f in added if f not in copy]
 
@@ -108,10 +108,10 @@
         ):
             if repo.ui.verbose:
                 repo.ui.status(
-                    _('detected move of %s as %s (%d%% similar)\n')
+                    _(b'detected move of %s as %s (%d%% similar)\n')
                     % (uipathfn(src), uipathfn(dst), score * 100)
                 )
             renames[dst] = src
     if renames:
-        repo.ui.status(_('detected move of %d files\n') % len(renames))
+        repo.ui.status(_(b'detected move of %d files\n') % len(renames))
     return renames