Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/revset.py @ 34458:2c3b8fa3211b
revset: add experimental support for extdata
This is minimal and non-controversial implementation of extdata() revset.
Originally extdata sources were exposed to the symbol namespace, but I've
changed it to a plain function for simplicity.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 01 Oct 2017 10:50:00 +0100 |
parents | b0790bebfcf8 |
children | 39b094e4ae2c |
comparison
equal
deleted
inserted
replaced
34457:7757cc48b766 | 34458:2c3b8fa3211b |
---|---|
784 # i18n: "contentdivergent" is a keyword | 784 # i18n: "contentdivergent" is a keyword |
785 getargs(x, 0, 0, _("contentdivergent takes no arguments")) | 785 getargs(x, 0, 0, _("contentdivergent takes no arguments")) |
786 contentdivergent = obsmod.getrevs(repo, 'contentdivergent') | 786 contentdivergent = obsmod.getrevs(repo, 'contentdivergent') |
787 return subset & contentdivergent | 787 return subset & contentdivergent |
788 | 788 |
789 @predicate('extdata(source)', safe=False, weight=100) | |
790 def extdata(repo, subset, x): | |
791 """Changesets in the specified extdata source. (EXPERIMENTAL)""" | |
792 # i18n: "extdata" is a keyword | |
793 args = getargsdict(x, 'extdata', 'source') | |
794 source = getstring(args.get('source'), | |
795 # i18n: "extdata" is a keyword | |
796 _('extdata takes at least 1 string argument')) | |
797 data = scmutil.extdatasource(repo, source) | |
798 return subset & baseset(data) | |
799 | |
789 @predicate('extinct()', safe=True) | 800 @predicate('extinct()', safe=True) |
790 def extinct(repo, subset, x): | 801 def extinct(repo, subset, x): |
791 """Obsolete changesets with obsolete descendants only. | 802 """Obsolete changesets with obsolete descendants only. |
792 """ | 803 """ |
793 # i18n: "extinct" is a keyword | 804 # i18n: "extinct" is a keyword |