# HG changeset patch # User Yuya Nishihara # Date 2015-09-10 14:32:36 # Node ID d3dbb65c8dc61260460df49c392248199441547d # Parent 43f9976346e9390b0723acf9d18e73c117fd11d8 fileset: handle error of string unescaping diff --git a/mercurial/fileset.py b/mercurial/fileset.py --- a/mercurial/fileset.py +++ b/mercurial/fileset.py @@ -54,7 +54,7 @@ def tokenize(program): c = program[pos] decode = lambda x: x else: - decode = lambda x: x.decode('string-escape') + decode = parser.unescapestr pos += 1 s = pos while pos < l: # find closing quote diff --git a/tests/test-fileset.t b/tests/test-fileset.t --- a/tests/test-fileset.t +++ b/tests/test-fileset.t @@ -49,6 +49,9 @@ Test operators and basic patterns $ fileset 'a* - a1' a2 $ fileset 'a_b' + $ fileset '"\xy"' + hg: parse error: invalid \x escape + [255] Test files status