##// END OF EJS Templates
revset: add support of keyword arguments to ancestors() and descendants()...
Yuya Nishihara -
r32914:577759ef default
parent child Browse files
Show More
@@ -250,7 +250,11 b' def ancestors(repo, subset, x):'
250 """Changesets that are ancestors of changesets in set, including the
250 """Changesets that are ancestors of changesets in set, including the
251 given changesets themselves.
251 given changesets themselves.
252 """
252 """
253 return _ancestors(repo, subset, x)
253 args = getargsdict(x, 'ancestors', 'set')
254 if 'set' not in args:
255 # i18n: "ancestors" is a keyword
256 raise error.ParseError(_('ancestors takes at least 1 argument'))
257 return _ancestors(repo, subset, args['set'])
254
258
255 @predicate('_firstancestors', safe=True)
259 @predicate('_firstancestors', safe=True)
256 def _firstancestors(repo, subset, x):
260 def _firstancestors(repo, subset, x):
@@ -596,7 +600,11 b' def descendants(repo, subset, x):'
596 """Changesets which are descendants of changesets in set, including the
600 """Changesets which are descendants of changesets in set, including the
597 given changesets themselves.
601 given changesets themselves.
598 """
602 """
599 return _descendants(repo, subset, x)
603 args = getargsdict(x, 'descendants', 'set')
604 if 'set' not in args:
605 # i18n: "descendants" is a keyword
606 raise error.ParseError(_('descendants takes at least 1 argument'))
607 return _descendants(repo, subset, args['set'])
600
608
601 @predicate('_firstdescendants', safe=True)
609 @predicate('_firstdescendants', safe=True)
602 def _firstdescendants(repo, subset, x):
610 def _firstdescendants(repo, subset, x):
@@ -2996,8 +2996,7 b' optimization to only() works only if anc'
2996 ('symbol', '1'))
2996 ('symbol', '1'))
2997 any)
2997 any)
2998 define)
2998 define)
2999 hg: parse error: can't use a list in this context
2999 hg: parse error: ancestors takes at most 1 positional arguments
3000 (see hg help "revsets.x or y")
3001 [255]
3000 [255]
3002 $ hg debugrevspec -p optimized 'ancestors(6, 1) - ancestors(4)'
3001 $ hg debugrevspec -p optimized 'ancestors(6, 1) - ancestors(4)'
3003 * optimized:
3002 * optimized:
@@ -3013,8 +3012,7 b' optimization to only() works only if anc'
3013 ('symbol', '4')
3012 ('symbol', '4')
3014 any)
3013 any)
3015 define)
3014 define)
3016 hg: parse error: can't use a list in this context
3015 hg: parse error: ancestors takes at most 1 positional arguments
3017 (see hg help "revsets.x or y")
3018 [255]
3016 [255]
3019
3017
3020 optimization disabled if keyword arguments passed (because we're too lazy
3018 optimization disabled if keyword arguments passed (because we're too lazy
@@ -3036,8 +3034,9 b' to support it)'
3036 ('symbol', '4'))
3034 ('symbol', '4'))
3037 any)
3035 any)
3038 define)
3036 define)
3039 hg: parse error: can't use a key-value pair in this context
3037 3
3040 [255]
3038 5
3039 6
3041
3040
3042 invalid function call should not be optimized to only()
3041 invalid function call should not be optimized to only()
3043
3042
General Comments 0
You need to be logged in to leave comments. Login now