localrepo: improve docstring for revset methods
authorGregory Szorc <gregory.szorc@gmail.com>
Sat, 21 Nov 2015 11:07:30 -0800
changeset 27071 dfb31eebd949
parent 27070 7860366b46c9
child 27072 e18a9ceade3b
localrepo: improve docstring for revset methods revs() doesn't return a list. Also document what its arguments do. Also clarify that set() is just a convenience wrapper around revs().
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Sun Nov 22 16:23:20 2015 -0800
+++ b/mercurial/localrepo.py	Sat Nov 21 11:07:30 2015 -0800
@@ -517,15 +517,23 @@
         return iter(self.changelog)
 
     def revs(self, expr, *args):
-        '''Return a list of revisions matching the given revset'''
+        '''Find revisions matching a revset.
+
+        The revset is specified as a string ``expr`` that may contain
+        %-formatting to escape certain types. See ``revset.formatspec``.
+
+        Return a revset.abstractsmartset, which is a list-like interface
+        that contains integer revisions.
+        '''
         expr = revset.formatspec(expr, *args)
         m = revset.match(None, expr)
         return m(self)
 
     def set(self, expr, *args):
-        '''
-        Yield a context for each matching revision, after doing arg
-        replacement via revset.formatspec
+        '''Find revisions matching a revset and emit changectx instances.
+
+        This is a convenience wrapper around ``revs()`` that iterates the
+        result and is a generator of changectx instances.
         '''
         for r in self.revs(expr, *args):
             yield self[r]