fileset: handle error of string unescaping
authorYuya Nishihara <yuya@tcha.org>
Thu, 10 Sep 2015 23:32:36 +0900
changeset 26233 d3dbb65c8dc6
parent 26232 43f9976346e9
child 26234 e4609ec959f8
fileset: handle error of string unescaping
mercurial/fileset.py
tests/test-fileset.t
--- a/mercurial/fileset.py	Thu Sep 10 23:29:55 2015 +0900
+++ b/mercurial/fileset.py	Thu Sep 10 23:32:36 2015 +0900
@@ -54,7 +54,7 @@
                 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
--- a/tests/test-fileset.t	Thu Sep 10 23:29:55 2015 +0900
+++ b/tests/test-fileset.t	Thu Sep 10 23:32:36 2015 +0900
@@ -49,6 +49,9 @@
   $ fileset 'a* - a1'
   a2
   $ fileset 'a_b'
+  $ fileset '"\xy"'
+  hg: parse error: invalid \x escape
+  [255]
 
 Test files status