mercurial/revset.py
changeset 12408 78a97859b90d
parent 12401 4cdaf1adafc8
child 12615 64db820c66a2
--- a/mercurial/revset.py	Sun Sep 26 13:11:31 2010 -0500
+++ b/mercurial/revset.py	Fri Sep 24 15:36:53 2010 -0500
@@ -48,7 +48,14 @@
             pos += 1 # skip ahead
         elif c in "():,-|&+!": # handle simple operators
             yield (c, None, pos)
-        elif c in '"\'': # handle quoted strings
+        elif (c in '"\'' or c == 'r' and
+              program[pos:pos + 2] in ("r'", 'r"')): # handle quoted strings
+            if c == 'r':
+                pos += 1
+                c = program[pos]
+                decode = lambda x: x
+            else:
+                decode = lambda x: x.decode('string-escape')
             pos += 1
             s = pos
             while pos < l: # find closing quote
@@ -57,7 +64,7 @@
                     pos += 2
                     continue
                 if d == c:
-                    yield ('string', program[s:pos].decode('string-escape'), s)
+                    yield ('string', decode(program[s:pos]), s)
                     break
                 pos += 1
             else: