Patchwork [1,of,3] revert: add a fullreposet class

login
register
mail settings
Submitter Pierre-Yves David
Date Sept. 20, 2014, 12:07 a.m.
Message ID <9daf8851618b46b11231.1411171655@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/5891/
State Superseded
Commit 2434c68d82a8a258087b8a75c3083453d691dc51
Headers show

Comments

Pierre-Yves David - Sept. 20, 2014, 12:07 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1398823575 25200
#      Tue Apr 29 19:06:15 2014 -0700
# Node ID 9daf8851618b46b112314848bd639dadf6ca7381
# Parent  273bf648227540a7ef87c4794e96b8a9d915d5b7
revert: add a fullreposet class

Every revset evaluation starts from `subset = spanset(repo)` and a lot of
revset predicates build a `spansetrepo` for their internal needs.

`spanset` is a generic class that can handle any situation. As a result a lot
of operation between spanset result in an `orderedlazyset`, a safe object but
suboptimal in may situation.

So we introduce a `fullreposet` class where some of the operation will be
overwritten to produce more interesting results.

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -2845,7 +2845,16 @@  class spanset(_orderedsetmixin):
         return self._start >= self._end
 
     def filter(self, l):
         return orderedlazyset(self, l, ascending=self.isascending())
 
+class fullreposet(spanset):
+    """a set containing all revisions in the repo
+
+    This class exists to host special optimisation.
+    """
+
+    def __init__(self, repo):
+        super(fullreposet, self).__init__(repo)
+
 # tell hggettext to extract docstrings from these functions:
 i18nfunctions = symbols.values()