Patchwork [8,of,8,STABLE] revset: drop spanset._contained

login
register
mail settings
Submitter Pierre-Yves David
Date April 29, 2014, 12:48 a.m.
Message ID <093d17f55d0d46a55cdd.1398732515@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/4452/
State Superseded
Commit b7f49b7652411f9c38b2f49fad9da54510d2bb67
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 1398494304 25200
#      Fri Apr 25 23:38:24 2014 -0700
# Branch stable
# Node ID 093d17f55d0d46a55cddb5430c0e4f4a3641477b
# Parent  00d62213d5785c5875d2251d3cde737b994ca1c6
revset: drop spanset._contained

All its users inlined it for performance reasons.
Durham Goode - April 29, 2014, 2:29 a.m.
On 4/28/14, 5:48 PM, "pierre-yves.david@ens-lyon.org"
<pierre-yves.david@ens-lyon.org> wrote:

># HG changeset patch
># User Pierre-Yves David <pierre-yves.david@fb.com>
># Date 1398494304 25200
>#      Fri Apr 25 23:38:24 2014 -0700
># Branch stable
># Node ID 093d17f55d0d46a55cddb5430c0e4f4a3641477b
># Parent  00d62213d5785c5875d2251d3cde737b994ca1c6
>revset: drop spanset._contained
>
>All its users inlined it for performance reasons.
>
>diff --git a/mercurial/revset.py b/mercurial/revset.py
>--- a/mercurial/revset.py
>+++ b/mercurial/revset.py
>@@ -2761,14 +2761,10 @@ class spanset(_orderedsetmixin):
> 
>     def descending(self):
>         if self._start < self._end:
>             self.reverse()
> 
>-    def _contained(self, rev):
>-        return ((self._end < rev <= self._start)
>-                 or (self._start <= rev < self._end))
>-
>     def __iter__(self):
>         if self._start <= self._end:
>             iterrange = xrange(self._start, self._end)
>         else:
>             iterrange = xrange(self._start, self._end, -1)

This series looks good to me.  Leaving for Matt to queue since it¹s stable
and late in the freeze.
Matt Mackall - April 30, 2014, 8:19 p.m.
On Tue, 2014-04-29 at 02:29 +0000, Durham Goode wrote:
> On 4/28/14, 5:48 PM, "pierre-yves.david@ens-lyon.org"
> <pierre-yves.david@ens-lyon.org> wrote:
> 
> ># HG changeset patch
> ># User Pierre-Yves David <pierre-yves.david@fb.com>
> ># Date 1398494304 25200
> >#      Fri Apr 25 23:38:24 2014 -0700
> ># Branch stable
> ># Node ID 093d17f55d0d46a55cddb5430c0e4f4a3641477b
> ># Parent  00d62213d5785c5875d2251d3cde737b994ca1c6
> >revset: drop spanset._contained

I've pushed 1, 2, 3, 6, and 7, thanks. The other bits can wait until
default reopens.

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -2761,14 +2761,10 @@  class spanset(_orderedsetmixin):
 
     def descending(self):
         if self._start < self._end:
             self.reverse()
 
-    def _contained(self, rev):
-        return ((self._end < rev <= self._start)
-                 or (self._start <= rev < self._end))
-
     def __iter__(self):
         if self._start <= self._end:
             iterrange = xrange(self._start, self._end)
         else:
             iterrange = xrange(self._start, self._end, -1)