mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 16:31:02 +03:00
revset: fix nth ancestor revset w/ multiple bases
Summary: The nth ancestor revset was crashing with multiple base revisions, e.g. "(. + .^)~". Fix variable shadowing issue in revset.ancestorspec. Differential Revision: D30375233 fbshipit-source-id: 37a78bf1000a40872600e587733a84029f68343b
This commit is contained in:
parent
50cf59e766
commit
a75c3e60e3
@ -576,9 +576,9 @@ def ancestorspec(repo, subset, x, n, order):
|
||||
nullrev = node.nullrev
|
||||
for r in s:
|
||||
if r != nullrev:
|
||||
n = firstancestornth(tonode(r), n)
|
||||
if n is not None:
|
||||
psadd(torev(n))
|
||||
ancestor = firstancestornth(tonode(r), n)
|
||||
if ancestor is not None:
|
||||
psadd(torev(ancestor))
|
||||
return subset & baseset(ps, repo=repo)
|
||||
|
||||
|
||||
|
@ -2680,3 +2680,9 @@ sh % "hg log -r '\n. +\n.^ +'" == r"""
|
||||
( . + .^ +
|
||||
^ here)
|
||||
[255]"""
|
||||
|
||||
# test ancestorspec with multiple base revisions
|
||||
|
||||
sh % "log '(. + .^)~1'" == r"""
|
||||
4
|
||||
8"""
|
||||
|
Loading…
Reference in New Issue
Block a user