comparison mercurial/revset.py @ 42264:6bc1245cd598

revset: populate wdir() by its hash or revision number It belongs to the same category as the null hash/revision, and we do handle these virtual identifiers in id()/rev() predicates. Let's do that more consistently.
author Yuya Nishihara <yuya@tcha.org>
date Tue, 30 Apr 2019 15:15:57 +0900
parents a0c5e06e9b1a
children d279e4f453c4
comparison
equal deleted inserted replaced
42262:a0c5e06e9b1a 42264:6bc1245cd598
121 121
122 def stringset(repo, subset, x, order): 122 def stringset(repo, subset, x, order):
123 if not x: 123 if not x:
124 raise error.ParseError(_("empty string is not a valid revision")) 124 raise error.ParseError(_("empty string is not a valid revision"))
125 x = scmutil.intrev(scmutil.revsymbol(repo, x)) 125 x = scmutil.intrev(scmutil.revsymbol(repo, x))
126 if (x in subset 126 if x in subset or x in _virtualrevs and isinstance(subset, fullreposet):
127 or x == node.nullrev and isinstance(subset, fullreposet)):
128 return baseset([x]) 127 return baseset([x])
129 return baseset() 128 return baseset()
130 129
131 def rawsmartset(repo, subset, x, order): 130 def rawsmartset(repo, subset, x, order):
132 """argument is already a smartset, use that directly""" 131 """argument is already a smartset, use that directly"""
2263 2262
2264 for r in revs: 2263 for r in revs:
2265 if r in seen: 2264 if r in seen:
2266 continue 2265 continue
2267 if (r in subset 2266 if (r in subset
2268 or r == node.nullrev and isinstance(subset, fullreposet)): 2267 or r in _virtualrevs and isinstance(subset, fullreposet)):
2269 ls.append(r) 2268 ls.append(r)
2270 seen.add(r) 2269 seen.add(r)
2271 return baseset(ls) 2270 return baseset(ls)
2272 2271
2273 # for internal use 2272 # for internal use