[PATCH 3 of 4 py3] help: use pycompat.sysstr() to make `a in b` work

Pulkit Goyal 7895pulkit at gmail.com
Sun Mar 12 13:19:50 EDT 2017


# HG changeset patch
# User Pulkit Goyal <7895pulkit at gmail.com>
# Date 1489338223 -19800
#      Sun Mar 12 22:33:43 2017 +0530
# Node ID 6cccbcf562c29d073d9cdf775fb07e40e32fad0b
# Parent  782455a21077bef9c13532ad8dfa69fde1e5ebfc
help: use pycompat.sysstr() to make `a in b` work

doc is unicode here, making doc bytes was an option but here we are just
evaluating an expression so I guess the other way around will be okay.

diff -r 782455a21077 -r 6cccbcf562c2 mercurial/help.py
--- a/mercurial/help.py	Sun Mar 12 22:27:53 2017 +0530
+++ b/mercurial/help.py	Sun Mar 12 22:33:43 2017 +0530
@@ -23,6 +23,7 @@
     filemerge,
     fileset,
     minirst,
+    pycompat,
     revset,
     templatefilters,
     templatekw,
@@ -109,7 +110,7 @@
 def filtercmd(ui, cmd, kw, doc):
     if not ui.debugflag and cmd.startswith("debug") and kw != "debug":
         return True
-    if not ui.verbose and doc and any(w in doc for w in _exclkeywords):
+    if not ui.verbose and doc and any(pycompat.sysstr(w) in doc for w in _exclkeywords):
         return True
     return False
 


More information about the Mercurial-devel mailing list