Patchwork [2,of,3] revset: remove false condition to process 'negate' operator

login
register
mail settings
Submitter Yuya Nishihara
Date Sept. 2, 2016, 2:58 p.m.
Message ID <04d0742aa7ecb239a06b.1472828291@mimosa>
Download mbox | patch
Permalink /patch/16531/
State Accepted
Headers show

Comments

Yuya Nishihara - Sept. 2, 2016, 2:58 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1470546807 -32400
#      Sun Aug 07 14:13:27 2016 +0900
# Node ID 04d0742aa7ecb239a06ba46e9f8ebe0c52a86e9d
# Parent  5cb90003deb87ae58f620657ec891df26e04c72a
revset: remove false condition to process 'negate' operator

'negate' is mapped to 'string' at the above clause.

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -2371,7 +2371,7 @@  def _optimize(x, small):
     elif op == 'negate':
         s = getstring(x[1], _("can't negate that"))
         return _optimize(('string', '-' + s), small)
-    elif op in 'string symbol negate':
+    elif op in 'string symbol':
         return smallbonus, x # single revisions are small
     elif op == 'and':
         wa, ta = _optimize(x[1], True)