diff hgext/pager.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/pager.py	Sun Oct 06 09:45:02 2019 -0400
+++ b/hgext/pager.py	Sun Oct 06 09:48:39 2019 -0400
@@ -35,29 +35,29 @@
 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
 # be specifying the version(s) of Mercurial they are tested with, or
 # leave the attribute unspecified.
-testedwith = 'ships-with-hg-core'
+testedwith = b'ships-with-hg-core'
 
 configtable = {}
 configitem = registrar.configitem(configtable)
 
 configitem(
-    'pager', 'attend', default=lambda: attended,
+    b'pager', b'attend', default=lambda: attended,
 )
 
 
 def uisetup(ui):
     def pagecmd(orig, ui, options, cmd, cmdfunc):
-        auto = options['pager'] == 'auto'
+        auto = options[b'pager'] == b'auto'
         if auto and not ui.pageractive:
             usepager = False
-            attend = ui.configlist('pager', 'attend')
-            ignore = ui.configlist('pager', 'ignore')
+            attend = ui.configlist(b'pager', b'attend')
+            ignore = ui.configlist(b'pager', b'ignore')
             cmds, _ = cmdutil.findcmd(cmd, commands.table)
 
             for cmd in cmds:
-                var = 'attend-%s' % cmd
-                if ui.config('pager', var, None):
-                    usepager = ui.configbool('pager', var, True)
+                var = b'attend-%s' % cmd
+                if ui.config(b'pager', var, None):
+                    usepager = ui.configbool(b'pager', var, True)
                     break
                 if cmd in attend or (cmd not in ignore and not attend):
                     usepager = True
@@ -69,13 +69,13 @@
                 # core code doesn't know about attend, so we have to
                 # lobotomize the ignore list so that the extension's
                 # behavior is preserved.
-                ui.setconfig('pager', 'ignore', '', 'pager')
-                ui.pager('extension-via-attend-' + cmd)
+                ui.setconfig(b'pager', b'ignore', b'', b'pager')
+                ui.pager(b'extension-via-attend-' + cmd)
             else:
                 ui.disablepager()
         return orig(ui, options, cmd, cmdfunc)
 
-    extensions.wrapfunction(dispatch, '_runcommand', pagecmd)
+    extensions.wrapfunction(dispatch, b'_runcommand', pagecmd)
 
 
-attended = ['annotate', 'cat', 'diff', 'export', 'glog', 'log', 'qdiff']
+attended = [b'annotate', b'cat', b'diff', b'export', b'glog', b'log', b'qdiff']