mercurial/revset.py
changeset 25704 70a2082f855a
parent 25689 1cce81121472
child 25705 48919d246a47
--- a/mercurial/revset.py	Sun Jun 28 12:46:34 2015 -0700
+++ b/mercurial/revset.py	Sat Jun 27 17:05:28 2015 +0900
@@ -133,6 +133,7 @@
     "or": (4, None, ("or", 4)),
     "|": (4, None, ("or", 4)),
     "+": (4, None, ("or", 4)),
+    "=": (3, None, ("keyvalue", 3)),
     ",": (2, None, ("list", 2)),
     ")": (0, None, None),
     "symbol": (0, ("symbol",), None),
@@ -190,7 +191,7 @@
         elif c == '#' and program[pos:pos + 2] == '##': # look ahead carefully
             yield ('##', None, pos)
             pos += 1 # skip ahead
-        elif c in "():,-|&+!~^%": # handle simple operators
+        elif c in "():=,-|&+!~^%": # handle simple operators
             yield (c, None, pos)
         elif (c in '"\'' or c == 'r' and
               program[pos:pos + 2] in ("r'", 'r"')): # handle quoted strings
@@ -388,6 +389,9 @@
 def listset(repo, subset, a, b):
     raise error.ParseError(_("can't use a list in this context"))
 
+def keyvaluepair(repo, subset, k, v):
+    raise error.ParseError(_("can't use a key-value pair in this context"))
+
 def func(repo, subset, a, b):
     if a[0] == 'symbol' and a[1] in symbols:
         return symbols[a[1]](repo, subset, b)
@@ -2180,6 +2184,7 @@
     "or": orset,
     "not": notset,
     "list": listset,
+    "keyvalue": keyvaluepair,
     "func": func,
     "ancestor": ancestorspec,
     "parent": parentspec,