mercurial/subrepo.py
changeset 31451 53865692a354
parent 31325 b589f5b953f4
child 31551 f97e90fa5ad7
--- a/mercurial/subrepo.py	Mon Mar 13 09:24:53 2017 -0700
+++ b/mercurial/subrepo.py	Wed Mar 15 23:06:50 2017 +0900
@@ -130,7 +130,7 @@
         for pattern, repl in p.items('subpaths'):
             # Turn r'C:\foo\bar' into r'C:\\foo\\bar' since re.sub
             # does a string decode.
-            repl = repl.encode('string-escape')
+            repl = util.escapestr(repl)
             # However, we still want to allow back references to go
             # through unharmed, so we turn r'\\1' into r'\1'. Again,
             # extra escapes are needed because re.sub string decodes.