# HG changeset patch # User Gregory Szorc # Date 2015-11-21 19:07:30 # Node ID dfb31eebd9493d3a8f15f3d4509db0afeffd2acf # Parent 7860366b46c9515383a72cebfd206b642980256d 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(). diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -517,15 +517,23 @@ class localrepository(object): 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]