--- 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':
--- a/tests/test-revset Wed Jun 30 17:34:20 2010 -0500
+++ b/tests/test-revset Wed Jun 30 17:44:36 2010 -0500
@@ -133,3 +133,4 @@
log '(1 and 2)::'
log '(1 and 2):'
log '(1 and 2):3'
+log 'sort(head(), -rev)'
--- a/tests/test-revset.out Wed Jun 30 17:34:20 2010 -0500
+++ b/tests/test-revset.out Wed Jun 30 17:44:36 2010 -0500
@@ -210,3 +210,13 @@
% log '(1 and 2)::'
% log '(1 and 2):'
% log '(1 and 2):3'
+% log 'sort(head(), -rev)'
+9
+7
+6
+5
+4
+3
+2
+1
+0