comparison mercurial/revset.py @ 17265:c30307eeec4b stable

revset: polish explanation of the difference between file() and filelog()
author Greg Ward <greg@gerg.ca>
date Wed, 25 Jul 2012 22:41:26 -0400
parents e96ad092fb18
children 632fa86aac55
comparison
equal deleted inserted replaced
17264:ec7b9bec19c9 17265:c30307eeec4b
652 652
653 def filelog(repo, subset, x): 653 def filelog(repo, subset, x):
654 """``filelog(pattern)`` 654 """``filelog(pattern)``
655 Changesets connected to the specified filelog. 655 Changesets connected to the specified filelog.
656 656
657 If you want to get all changesets affecting matched files exactly, 657 For performance reasons, ``filelog()`` does not show every changeset
658 use ``file()`` predicate, because ``filelog()`` may omit some changesets 658 that affects the requested file(s). See :hg:`help log` for details. For
659 for performance reasons: see :hg:`help log` for detail. 659 a slower, more accurate result, use ``file()``.
660 """ 660 """
661 661
662 # i18n: "filelog" is a keyword 662 # i18n: "filelog" is a keyword
663 pat = getstring(x, _("filelog requires a pattern")) 663 pat = getstring(x, _("filelog requires a pattern"))
664 m = matchmod.match(repo.root, repo.getcwd(), [pat], default='relpath', 664 m = matchmod.match(repo.root, repo.getcwd(), [pat], default='relpath',
809 809
810 def hasfile(repo, subset, x): 810 def hasfile(repo, subset, x):
811 """``file(pattern)`` 811 """``file(pattern)``
812 Changesets affecting files matched by pattern. 812 Changesets affecting files matched by pattern.
813 813
814 If you want to pick changesets up fast, consider to 814 For a faster but less accurate result, consider using ``filelog()``
815 use ``filelog()`` predicate, too. 815 instead.
816 """ 816 """
817 # i18n: "file" is a keyword 817 # i18n: "file" is a keyword
818 pat = getstring(x, _("file requires a pattern")) 818 pat = getstring(x, _("file requires a pattern"))
819 return _matchfiles(repo, subset, ('string', 'p:' + pat)) 819 return _matchfiles(repo, subset, ('string', 'p:' + pat))
820 820