Mercurial > public > mercurial-scm > hg-stable
diff mercurial/subrepo.py @ 31460:53865692a354
util: wrap s.encode('string_escape') call for future py3 compatibility
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Wed, 15 Mar 2017 23:06:50 +0900 |
parents | b589f5b953f4 |
children | f97e90fa5ad7 |
line wrap: on
line diff
--- 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.