util: use bytes re on bytes input in fspath
authorAugie Fackler <augie@google.com>
Sun, 19 Mar 2017 00:16:39 -0400
changeset 31496 670166e0fcaa
parent 31495 d1937bdcee8c
child 31497 a369482e9649
util: use bytes re on bytes input in fspath Fixes `hg add` on Python 3.
mercurial/util.py
--- a/mercurial/util.py	Sun Mar 19 00:16:08 2017 -0400
+++ b/mercurial/util.py	Sun Mar 19 00:16:39 2017 -0400
@@ -1331,7 +1331,7 @@
         seps = seps + pycompat.osaltsep
     # Protect backslashes. This gets silly very quickly.
     seps.replace('\\','\\\\')
-    pattern = remod.compile(r'([^%s]+)|([%s]+)' % (seps, seps))
+    pattern = remod.compile(br'([^%s]+)|([%s]+)' % (seps, seps))
     dir = os.path.normpath(root)
     result = []
     for part, sep in pattern.findall(name):