comparison hgext/narrow/narrowtemplates.py @ 36439:02cd2fb6de72

narrow: drop redundant templatekw/revset names from help text ":<name>:" is automatically added by the registrar.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 25 Feb 2018 13:42:51 +0900
parents ea02be8665ef
children d0d5eef57fb0
comparison
equal deleted inserted replaced
36438:93228b2a1fc0 36439:02cd2fb6de72
22 return True 22 return True
23 return False 23 return False
24 24
25 @templatekeyword('ellipsis') 25 @templatekeyword('ellipsis')
26 def ellipsis(repo, ctx, templ, **args): 26 def ellipsis(repo, ctx, templ, **args):
27 """:ellipsis: String. 'ellipsis' if the change is an ellipsis node, 27 """String. 'ellipsis' if the change is an ellipsis node, else ''."""
28 else ''."""
29 if _isellipsis(repo, ctx.rev()): 28 if _isellipsis(repo, ctx.rev()):
30 return 'ellipsis' 29 return 'ellipsis'
31 return '' 30 return ''
32 31
33 @templatekeyword('outsidenarrow') 32 @templatekeyword('outsidenarrow')
34 def outsidenarrow(repo, ctx, templ, **args): 33 def outsidenarrow(repo, ctx, templ, **args):
35 """:outsidenarrow: String. 'outsidenarrow' if the change affects no 34 """String. 'outsidenarrow' if the change affects no tracked files,
36 tracked files, else ''.""" 35 else ''."""
37 if util.safehasattr(repo, 'narrowmatch'): 36 if util.safehasattr(repo, 'narrowmatch'):
38 m = repo.narrowmatch() 37 m = repo.narrowmatch()
39 if not any(m(f) for f in ctx.files()): 38 if not any(m(f) for f in ctx.files()):
40 return 'outsidenarrow' 39 return 'outsidenarrow'
41 return '' 40 return ''
42 41
43 @revsetpredicate('ellipsis') 42 @revsetpredicate('ellipsis')
44 def ellipsisrevset(repo, subset, x): 43 def ellipsisrevset(repo, subset, x):
45 """``ellipsis()`` 44 """Changesets that are ellipsis nodes."""
46 Changesets that are ellipsis nodes.
47 """
48 return subset.filter(lambda r: _isellipsis(repo, r)) 45 return subset.filter(lambda r: _isellipsis(repo, r))