Patchwork [3,of,3] revset: drop factory that promotes spanset to fullreposet

login
register
mail settings
Submitter Yuya Nishihara
Date Feb. 10, 2015, 3:50 p.m.
Message ID <9962a866325681d8e452.1423583402@mimosa>
Download mbox | patch
Permalink /patch/7775/
State Accepted
Headers show

Comments

Yuya Nishihara - Feb. 10, 2015, 3:50 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1420728195 -32400
#      Thu Jan 08 23:43:15 2015 +0900
# Node ID 9962a866325681d8e4523ea30edd3e2ed8343f98
# Parent  f04a70f7f3a11b5c66dc739cdf6bcf57d59183ff
revset: drop factory that promotes spanset to fullreposet

All callers use fullreposet where appropriate.

Backed out changeset fbae659543cf
Augie Fackler - Feb. 10, 2015, 6:54 p.m.
On Wed, Feb 11, 2015 at 12:50:02AM +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1420728195 -32400
> #      Thu Jan 08 23:43:15 2015 +0900
> # Node ID 9962a866325681d8e4523ea30edd3e2ed8343f98
> # Parent  f04a70f7f3a11b5c66dc739cdf6bcf57d59183ff
> revset: drop factory that promotes spanset to fullreposet

On the whole, I like this enough and it seems "right" enough that I'm
happy to queue it.

Hopefully marmoute doesn't disagree with me when he's back. :)

>
> All callers use fullreposet where appropriate.
>
> Backed out changeset fbae659543cf
>
> diff --git a/mercurial/revset.py b/mercurial/revset.py
> --- a/mercurial/revset.py
> +++ b/mercurial/revset.py
> @@ -3204,18 +3204,7 @@ class generatorset(abstractsmartset):
>              return it().next()
>          return None
>
> -def spanset(repo, start=None, end=None):
> -    """factory function to dispatch between fullreposet and actual spanset
> -
> -    Feel free to update all spanset call sites and kill this function at some
> -    point.
> -    """
> -    if start is None and end is None:
> -        return fullreposet(repo)
> -    return _spanset(repo, start, end)
> -
> -
> -class _spanset(abstractsmartset):
> +class spanset(abstractsmartset):
>      """Duck type for baseset class which represents a range of revisions and
>      can work lazily and without having all the range in memory
>
> @@ -3319,7 +3308,7 @@ class _spanset(abstractsmartset):
>              return x
>          return None
>
> -class fullreposet(_spanset):
> +class fullreposet(spanset):
>      """a set containing all revisions in the repo
>
>      This class exists to host special optimization.
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
Pierre-Yves David - Feb. 25, 2015, 2:34 p.m.
On 02/10/2015 06:54 PM, Augie Fackler wrote:
> On Wed, Feb 11, 2015 at 12:50:02AM +0900, Yuya Nishihara wrote:
>> # HG changeset patch
>> # User Yuya Nishihara <yuya@tcha.org>
>> # Date 1420728195 -32400
>> #      Thu Jan 08 23:43:15 2015 +0900
>> # Node ID 9962a866325681d8e4523ea30edd3e2ed8343f98
>> # Parent  f04a70f7f3a11b5c66dc739cdf6bcf57d59183ff
>> revset: drop factory that promotes spanset to fullreposet
>
> On the whole, I like this enough and it seems "right" enough that I'm
> happy to queue it.
>
> Hopefully marmoute doesn't disagree with me when he's back. :)

I slightly disagree since multiple out of core extension will probably 
get impacted by this. But nothing should break and Matt will eventually 
ask me to reconcile my multiple personality together.
Augie Fackler - Feb. 25, 2015, 2:36 p.m.
On Wed, Feb 25, 2015 at 9:34 AM, Pierre-Yves David
<pierre-yves.david@ens-lyon.org> wrote:
>
> I slightly disagree since multiple out of core extension will probably get
> impacted by this.


http://mercurial.selenic.com/wiki/MercurialApi ;)

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -3204,18 +3204,7 @@  class generatorset(abstractsmartset):
             return it().next()
         return None
 
-def spanset(repo, start=None, end=None):
-    """factory function to dispatch between fullreposet and actual spanset
-
-    Feel free to update all spanset call sites and kill this function at some
-    point.
-    """
-    if start is None and end is None:
-        return fullreposet(repo)
-    return _spanset(repo, start, end)
-
-
-class _spanset(abstractsmartset):
+class spanset(abstractsmartset):
     """Duck type for baseset class which represents a range of revisions and
     can work lazily and without having all the range in memory
 
@@ -3319,7 +3308,7 @@  class _spanset(abstractsmartset):
             return x
         return None
 
-class fullreposet(_spanset):
+class fullreposet(spanset):
     """a set containing all revisions in the repo
 
     This class exists to host special optimization.