Patchwork [2,of,8,STABLE] revset: fix revision filtering in spanset.contains (regression)

login
register
mail settings
Submitter Pierre-Yves David
Date April 29, 2014, 12:48 a.m.
Message ID <3a33cd29d255c49d03a3.1398732509@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/4446/
State Accepted
Commit c8b9c6147108e2e9020ad7034a8632bd11345be5
Headers show

Comments

Pierre-Yves David - April 29, 2014, 12:48 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1398727732 25200
#      Mon Apr 28 16:28:52 2014 -0700
# Branch stable
# Node ID 3a33cd29d255c49d03a3ec9d63b48b6622941c5b
# Parent  80f58cb63468525ff8a3f17536608e307bdb26ca
revset: fix revision filtering in spanset.contains (regression)

The argument is `x` but the variable tested for filtering is `rev`. `rev`
happens to be a revset methods, ... never part of the filtered revs. This
method is now using `rev` for everything.

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -2780,12 +2780,12 @@  class spanset(_orderedsetmixin):
                     yield r
         else:
             for r in iterrange:
                 yield r
 
-    def __contains__(self, x):
-        return self._contained(x) and not (self._hiddenrevs and rev in
+    def __contains__(self, rev):
+        return self._contained(rev) and not (self._hiddenrevs and rev in
                 self._hiddenrevs)
 
     def __nonzero__(self):
         for r in self:
             return True