# HG changeset patch
# User Augie Fackler <au...@google.com>
# Date 1489896999 14400
#      Sun Mar 19 00:16:39 2017 -0400
# Node ID 71e1dc3a007cb77ca1db3c6c8d73acf94b0be653
# Parent  e9574463681c17cc07e37073beecf16c1b3a82ab
util: use bytes re on bytes input in fspath

Fixes `hg add` on Python 3.

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -1331,7 +1331,7 @@ def fspath(name, root):
         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):
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to