Mercurial > public > mercurial-scm > hg
comparison mercurial/revset.py @ 36607:c6061cadb400
util: extract all date-related utils in utils/dateutil module
With this commit, util.py lose 262 lines
Note for extensions author, if this commit breaks your extension, you can pull
the step-by-step split here to help you more easily pinpoint the renaming that
broke your extension:
hg pull https://bitbucket.org/octobus/mercurial-devel/ -r ac1f6453010d
Differential Revision: https://phab.mercurial-scm.org/D2282
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Thu, 15 Feb 2018 17:18:26 +0100 |
parents | b755eab7e677 |
children | 407934a97bc7 |
comparison
equal
deleted
inserted
replaced
36606:4de15c54e59f | 36607:c6061cadb400 |
---|---|
28 revsetlang, | 28 revsetlang, |
29 scmutil, | 29 scmutil, |
30 smartset, | 30 smartset, |
31 util, | 31 util, |
32 ) | 32 ) |
33 from .utils import dateutil | |
33 | 34 |
34 # helpers for processing parsed tree | 35 # helpers for processing parsed tree |
35 getsymbol = revsetlang.getsymbol | 36 getsymbol = revsetlang.getsymbol |
36 getstring = revsetlang.getstring | 37 getstring = revsetlang.getstring |
37 getinteger = revsetlang.getinteger | 38 getinteger = revsetlang.getinteger |
656 def date(repo, subset, x): | 657 def date(repo, subset, x): |
657 """Changesets within the interval, see :hg:`help dates`. | 658 """Changesets within the interval, see :hg:`help dates`. |
658 """ | 659 """ |
659 # i18n: "date" is a keyword | 660 # i18n: "date" is a keyword |
660 ds = getstring(x, _("date requires a string")) | 661 ds = getstring(x, _("date requires a string")) |
661 dm = util.matchdate(ds) | 662 dm = dateutil.matchdate(ds) |
662 return subset.filter(lambda x: dm(repo[x].date()[0]), | 663 return subset.filter(lambda x: dm(repo[x].date()[0]), |
663 condrepr=('<date %r>', ds)) | 664 condrepr=('<date %r>', ds)) |
664 | 665 |
665 @predicate('desc(string)', safe=True, weight=10) | 666 @predicate('desc(string)', safe=True, weight=10) |
666 def desc(repo, subset, x): | 667 def desc(repo, subset, x): |