Patchwork [2,of,6] baseset: update documentation

login
register
mail settings
Submitter Pierre-Yves David
Date Oct. 17, 2014, 5:50 p.m.
Message ID <33003da1d4ac6ae14cac.1413568212@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/6378/
State Deferred
Headers show

Comments

Pierre-Yves David - Oct. 17, 2014, 5:50 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1413524520 25200
#      Thu Oct 16 22:42:00 2014 -0700
# Node ID 33003da1d4ac6ae14cacc295b00ba0583ece96e8
# Parent  bb7965f00332db6792635e6c860bce4fad7c52b2
baseset: update documentation

The main documentation for date from its very first implementantion. Baseset is
no longer the template for all other smartsets. We update the documention with
more relevant information.

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -2293,14 +2293,17 @@  class abstractsmartset(object):
         if cache and util.safehasattr(condition, 'func_code'):
             condition = util.cachefunc(condition)
         return filteredset(self, condition)
 
 class baseset(abstractsmartset):
-    """Basic data structure that represents a revset and contains the basic
-    operation that it should be able to perform.
-
-    Every method in this class should be implemented by any smartset class.
+    """A smartset with explicit elements
+
+    A `baseset` object is provided all its content at creation time. All
+    sortings and reordering can then happen lazily and membership testing is
+    fast because it is backed up by a native python set. The iteration order is
+    controled by the order of data initially provided. To enforce a different
+    order, use the `.sort()` or `.sort(reverse=True)` methods.
     """
     def __init__(self, data=()):
         if not isinstance(data, list):
             data = list(data)
         self._list = data