test-ancestor.py: fix test_gca

Summary:
There were three things wrong, in order of discovery:
1. It wasn't testing anything because the "cl" changelog in-hand was empty. Fix by getting cl after importing commits. Didn't investigate further.
2. ancestors.py was broken due to a previous change in D43839498. Reverted that in preceding commit D46961670.
2. Revision numbers were too big for ancestors.py. Set devel.segmented-changelog-rev-compat=true to get smaller numbers.

Reviewed By: zzl0

Differential Revision: D46898400

fbshipit-source-id: 9b2bb25b457d1757851ed05d9a79da185593910d
This commit is contained in:
Muir Manders 2023-06-26 06:29:12 -07:00 committed by Facebook GitHub Bot
parent ed72586c25
commit d062b1fba9

View File

@ -253,12 +253,13 @@ dagtests = [
def test_gca(): def test_gca():
u = uimod.ui.load() u = uimod.ui.load()
u.setconfig("devel", "segmented-changelog-rev-compat", "true")
for i, (dag, tests) in enumerate(dagtests): for i, (dag, tests) in enumerate(dagtests):
repo = hg.repository(u, "gca%d" % i, create=1) repo = hg.repository(u, "gca%d" % i, create=1)
debugcommands.debugbuilddag(u, repo, dag)
cl = repo.changelog cl = repo.changelog
torevs = cl.torevs torevs = cl.torevs
tonodes = cl.tonodes tonodes = cl.tonodes
debugcommands.debugbuilddag(u, repo, dag)
# Compare the results of the Python and C versions. This does not # Compare the results of the Python and C versions. This does not
# include choosing a winner when more than one gca exists -- we make # include choosing a winner when more than one gca exists -- we make
# sure both return exactly the same set of gcas. # sure both return exactly the same set of gcas.