##// END OF EJS Templates
revset: leverage internal _rev() function to implement rev()...
Yuya Nishihara -
r45075:f913ece2 default
parent child Browse files
Show More
@@ -2082,19 +2082,11 b' def removes(repo, subset, x):'
2082
2082
2083 @predicate(b'rev(number)', safe=True)
2083 @predicate(b'rev(number)', safe=True)
2084 def rev(repo, subset, x):
2084 def rev(repo, subset, x):
2085 """Revision with the given numeric identifier.
2085 """Revision with the given numeric identifier."""
2086 """
2087 # i18n: "rev" is a keyword
2088 l = getargs(x, 1, 1, _(b"rev requires one argument"))
2089 try:
2086 try:
2090 # i18n: "rev" is a keyword
2087 return _rev(repo, subset, x)
2091 l = int(getstring(l[0], _(b"rev requires a number")))
2088 except error.RepoLookupError:
2092 except (TypeError, ValueError):
2093 # i18n: "rev" is a keyword
2094 raise error.ParseError(_(b"rev expects a number"))
2095 if l not in repo.changelog and l not in _virtualrevs:
2096 return baseset()
2089 return baseset()
2097 return subset & baseset([l])
2098
2090
2099
2091
2100 @predicate(b'_rev(number)', safe=True)
2092 @predicate(b'_rev(number)', safe=True)
General Comments 0
You need to be logged in to leave comments. Login now