changeset 22716:6877ba8d85ff

abstractsmartset: document the `fastasc` and `fastdesc` attributes/methods See the in-line documentation for details. (This is the beginning of a massive overhaul of revset).
author Pierre-Yves David <pierre-yves.david@fb.com>
date Tue, 30 Sep 2014 22:26:34 -0500
parents 557749fea14a
children b89f7e3a414d
files mercurial/revset.py
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revset.py	Thu Oct 02 18:35:56 2014 -0500
+++ b/mercurial/revset.py	Tue Sep 30 22:26:34 2014 -0500
@@ -2218,6 +2218,14 @@
         """iterate the set in the order it is supposed to be iterated"""
         raise NotImplementedError()
 
+    # Attributes containing a function to perform a fast iteration in a given
+    # direction. A smartset can have none, one, or both defined.
+    #
+    # Default value is None instead of a function returning None to avoid
+    # initializing an iterator just for testing if a fast method exists.
+    fastasc = None
+    fastdesc = None
+
     def isascending(self):
         """True if the set will iterate in ascending order"""
         raise NotImplementedError()