--- a/mercurial/localrepo.py Sun Feb 19 18:19:33 2017 +0900
+++ b/mercurial/localrepo.py Sun Feb 19 20:00:18 2017 +0900
@@ -577,7 +577,8 @@
%-formatting to escape certain types. See ``revsetlang.formatspec``.
Revset aliases from the configuration are not expanded. To expand
- user aliases, consider calling ``scmutil.revrange()``.
+ user aliases, consider calling ``scmutil.revrange()`` or
+ ``repo.anyrevs([expr], user=True)``.
Returns a revset.abstractsmartset, which is a list-like interface
that contains integer revisions.
@@ -598,6 +599,18 @@
for r in self.revs(expr, *args):
yield self[r]
+ def anyrevs(self, specs, user=False):
+ '''Find revisions matching one of the given revsets.
+
+ Revset aliases from the configuration are not expanded by default. To
+ expand user aliases, specify ``user=True``.
+ '''
+ if user:
+ m = revset.matchany(self.ui, specs, repo=self)
+ else:
+ m = revset.matchany(None, specs)
+ return m(self)
+
def url(self):
return 'file:' + self.root