mercurial/revset.py
branchstable
changeset 11467 6b836d5c8c9e
parent 11456 88abbb046e66
child 11650 ebaf117c2642
--- a/mercurial/revset.py	Wed Jun 30 17:34:20 2010 -0500
+++ b/mercurial/revset.py	Wed Jun 30 17:44:36 2010 -0500
@@ -111,10 +111,6 @@
 
 # operator methods
 
-def negate(repo, subset, x):
-    return getset(repo, subset,
-                  ('string', '-' + getstring(x, _("can't negate that"))))
-
 def stringset(repo, subset, x):
     x = repo[x].rev()
     if x == -1 and len(subset) == len(repo):
@@ -482,7 +478,6 @@
 }
 
 methods = {
-    "negate": negate,
     "range": rangeset,
     "string": stringset,
     "symbol": symbolset,
@@ -515,6 +510,9 @@
         return optimize(('range', ('string', '0'), x[1]), small)
     elif op == 'rangepost':
         return optimize(('range', x[1], ('string', 'tip')), small)
+    elif op == 'negate':
+        return optimize(('string',
+                         '-' + getstring(x[1], _("can't negate that"))), small)
     elif op in 'string symbol negate':
         return smallbonus, x # single revisions are small
     elif op == 'and' or op == 'dagrange':