comparison mercurial/revset.py @ 38522:54d7aaa243cc

revset: add partial support for ancestor(wdir()) It's easy, so let's make it happen. I'm not certain if 'wdir() &' should be required. ancestors(wdir()) works without it, but ancestor(wdir()) doesn't as of now. That's the issue of fullreposet.__contains__() vs __and__().
author Yuya Nishihara <yuya@tcha.org>
date Fri, 29 Jun 2018 23:13:23 +0900
parents 4455e5d4d59c
children 6ec996e8c9bc
comparison
equal deleted inserted replaced
38521:c1a7bbf9984d 38522:54d7aaa243cc
317 except StopIteration: 317 except StopIteration:
318 return baseset() 318 return baseset()
319 for r in reviter: 319 for r in reviter:
320 anc = anc.ancestor(repo[r]) 320 anc = anc.ancestor(repo[r])
321 321
322 if anc.rev() in subset: 322 r = scmutil.intrev(anc)
323 return baseset([anc.rev()]) 323 if r in subset:
324 return baseset([r])
324 return baseset() 325 return baseset()
325 326
326 def _ancestors(repo, subset, x, followfirst=False, startdepth=None, 327 def _ancestors(repo, subset, x, followfirst=False, startdepth=None,
327 stopdepth=None): 328 stopdepth=None):
328 heads = getset(repo, fullreposet(repo), x) 329 heads = getset(repo, fullreposet(repo), x)