diff mercurial/localrepo.py @ 29417:526b027b0130

scmutil: improve documentation of revset APIs I can never remember the differences between the various revset APIs. I can never remember that scmutil.revrange() is the one I want to use from user-facing commands. Add some documentation to clarify this. While we're here, the argument name for revrange() is changed to "specs" because that's what it actually is.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 25 Jun 2016 19:12:20 -0700
parents 36fbd72c2f39
children 41689e293994
line wrap: on
line diff
--- a/mercurial/localrepo.py	Sat Jun 25 13:52:46 2016 -0700
+++ b/mercurial/localrepo.py	Sat Jun 25 19:12:20 2016 -0700
@@ -554,7 +554,10 @@
         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
+        Revset aliases from the configuration are not expanded. To expand
+        user aliases, consider calling ``scmutil.revrange()``.
+
+        Returns a revset.abstractsmartset, which is a list-like interface
         that contains integer revisions.
         '''
         expr = revset.formatspec(expr, *args)
@@ -566,6 +569,9 @@
 
         This is a convenience wrapper around ``revs()`` that iterates the
         result and is a generator of changectx instances.
+
+        Revset aliases from the configuration are not expanded. To expand
+        user aliases, consider calling ``scmutil.revrange()``.
         '''
         for r in self.revs(expr, *args):
             yield self[r]