Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 31024:0b8356705de6
revset: split language services to revsetlang module (API)
New revsetlang module hosts parser, tokenizer, and miscellaneous functions
working on parsed tree. It does not include functions for evaluation such as
getset() and match().
2288 mercurial/revset.py
684 mercurial/revsetlang.py
2972 total
get*() functions are aliased since they are common in revset.py.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 19 Feb 2017 18:19:33 +0900 |
parents | 74af89c66834 |
children | 6cf2857526c7 |
comparison
equal
deleted
inserted
replaced
31023:aea06029919e | 31024:0b8356705de6 |
---|---|
48 peer, | 48 peer, |
49 phases, | 49 phases, |
50 pushkey, | 50 pushkey, |
51 repoview, | 51 repoview, |
52 revset, | 52 revset, |
53 revsetlang, | |
53 scmutil, | 54 scmutil, |
54 store, | 55 store, |
55 subrepo, | 56 subrepo, |
56 tags as tagsmod, | 57 tags as tagsmod, |
57 transaction, | 58 transaction, |
571 | 572 |
572 def revs(self, expr, *args): | 573 def revs(self, expr, *args): |
573 '''Find revisions matching a revset. | 574 '''Find revisions matching a revset. |
574 | 575 |
575 The revset is specified as a string ``expr`` that may contain | 576 The revset is specified as a string ``expr`` that may contain |
576 %-formatting to escape certain types. See ``revset.formatspec``. | 577 %-formatting to escape certain types. See ``revsetlang.formatspec``. |
577 | 578 |
578 Revset aliases from the configuration are not expanded. To expand | 579 Revset aliases from the configuration are not expanded. To expand |
579 user aliases, consider calling ``scmutil.revrange()``. | 580 user aliases, consider calling ``scmutil.revrange()``. |
580 | 581 |
581 Returns a revset.abstractsmartset, which is a list-like interface | 582 Returns a revset.abstractsmartset, which is a list-like interface |
582 that contains integer revisions. | 583 that contains integer revisions. |
583 ''' | 584 ''' |
584 expr = revset.formatspec(expr, *args) | 585 expr = revsetlang.formatspec(expr, *args) |
585 m = revset.match(None, expr) | 586 m = revset.match(None, expr) |
586 return m(self) | 587 return m(self) |
587 | 588 |
588 def set(self, expr, *args): | 589 def set(self, expr, *args): |
589 '''Find revisions matching a revset and emit changectx instances. | 590 '''Find revisions matching a revset and emit changectx instances. |