comparison mercurial/revset.py @ 17244:483aa765f6c4 stable

revset: add explanation about difference between 'filelog()' and 'file()'
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Wed, 25 Jul 2012 16:15:28 +0900
parents a3da6f298592
children 5822345e9e46
comparison
equal deleted inserted replaced
17243:106cdea0183d 17244:483aa765f6c4
644 return [r for r in subset if _matchvalue(r)] 644 return [r for r in subset if _matchvalue(r)]
645 645
646 def filelog(repo, subset, x): 646 def filelog(repo, subset, x):
647 """``filelog(pattern)`` 647 """``filelog(pattern)``
648 Changesets connected to the specified filelog. 648 Changesets connected to the specified filelog.
649
650 If you want to get all changesets affecting matched files exactly,
651 use ``file()`` predicate, because ``filelog()`` may omit some changesets
652 for performance reasons: see :hg:`help log` for detail.
649 """ 653 """
650 654
651 pat = getstring(x, _("filelog requires a pattern")) 655 pat = getstring(x, _("filelog requires a pattern"))
652 m = matchmod.match(repo.root, repo.getcwd(), [pat], default='relpath', 656 m = matchmod.match(repo.root, repo.getcwd(), [pat], default='relpath',
653 ctx=repo[None]) 657 ctx=repo[None])
792 return s 796 return s
793 797
794 def hasfile(repo, subset, x): 798 def hasfile(repo, subset, x):
795 """``file(pattern)`` 799 """``file(pattern)``
796 Changesets affecting files matched by pattern. 800 Changesets affecting files matched by pattern.
801
802 If you want to pick changesets up fast, consider to
803 use ``filelog()`` predicate, too.
797 """ 804 """
798 # i18n: "file" is a keyword 805 # i18n: "file" is a keyword
799 pat = getstring(x, _("file requires a pattern")) 806 pat = getstring(x, _("file requires a pattern"))
800 return _matchfiles(repo, subset, ('string', 'p:' + pat)) 807 return _matchfiles(repo, subset, ('string', 'p:' + pat))
801 808