# HG changeset patch # User Yuya Nishihara # Date 1441895395 -32400 # Node ID 43f9976346e9390b0723acf9d18e73c117fd11d8 # Parent 87c9c562c37ac5d41d7cd0902091b166044b0912 revset: handle error of string unescaping diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -244,7 +244,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 diff --git a/tests/test-revset.t b/tests/test-revset.t --- a/tests/test-revset.t +++ b/tests/test-revset.t @@ -353,6 +353,9 @@ $ log 'date(' hg: parse error at 5: not a prefix: end [255] + $ log 'date("\xy")' + hg: parse error: invalid \x escape + [255] $ log 'date(tip)' abort: invalid date: 'tip' [255]