#require no-reposimplestore Check whether size of generaldelta revlog is not bigger than its regular equivalent. Test would fail if generaldelta was naive implementation of parentdelta: third manifest revision would be fully inserted due to big distance from its paren revision (zero). $ hg init repo --config format.generaldelta=no --config format.usegeneraldelta=no $ cd repo $ echo foo > foo $ echo bar > bar $ echo baz > baz $ hg commit -q -Am boo $ hg clone --pull . ../gdrepo -q --config format.generaldelta=yes $ for r in 1 2 3; do > echo $r > foo > hg commit -q -m $r > hg up -q -r 0 > hg pull . -q -r $r -R ../gdrepo > done $ cd .. >>> from __future__ import print_function >>> import os >>> regsize = os.stat("repo/.hg/store/00manifest.i").st_size >>> gdsize = os.stat("gdrepo/.hg/store/00manifest.i").st_size >>> if regsize < gdsize: ... print('generaldata increased size of manifest') Verify rev reordering doesnt create invalid bundles (issue4462) This requires a commit tree that when pulled will reorder manifest revs such that the second manifest to create a file rev will be ordered before the first manifest to create that file rev. We also need to do a partial pull to ensure reordering happens. At the end we verify the linkrev points at the earliest commit. $ hg init server --config format.generaldelta=True $ cd server $ touch a $ hg commit -Aqm a $ echo x > x $ echo y > y $ hg commit -Aqm xy $ hg up -q '.^' $ echo x > x $ echo z > z $ hg commit -Aqm xz $ hg up -q 1 $ echo b > b $ hg commit -Aqm b $ hg merge -q 2 $ hg commit -Aqm merge $ echo c > c $ hg commit -Aqm c $ hg log -G -T '{rev} {shortest(node)} {desc}' @ 5 ebb8 c | o 4 baf7 merge |\ | o 3 a129 b | | o | 2 958c xz | | | o 1 f00c xy |/ o 0 3903 a $ cd .. $ hg init client --config format.generaldelta=false --config format.usegeneraldelta=false $ cd client $ hg pull -q ../server -r 4 $ hg debugdeltachain x rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio 0 1 1 -1 base 3 2 3 1.50000 3 0 0.00000 $ cd .. Test "usegeneraldelta" config (repo are general delta, but incoming bundle are not re-deltafied) delta coming from the server base delta server are not recompressed. (also include the aggressive version for comparison) $ hg clone repo --pull --config format.usegeneraldelta=1 usegd requesting all changes adding changesets adding manifests adding file changes added 4 changesets with 6 changes to 3 files (+2 heads) new changesets 0ea3fcf9d01d:bba78d330d9c updating to branch default 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg clone repo --pull --config format.generaldelta=1 full requesting all changes adding changesets adding manifests adding file changes added 4 changesets with 6 changes to 3 files (+2 heads) new changesets 0ea3fcf9d01d:bba78d330d9c updating to branch default 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -R repo debugdeltachain -m rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio 0 1 1 -1 base 104 135 104 0.77037 104 0 0.00000 1 1 2 0 prev 57 135 161 1.19259 161 0 0.00000 2 1 3 1 prev 57 135 218 1.61481 218 0 0.00000 3 2 1 -1 base 104 135 104 0.77037 104 0 0.00000 $ hg -R usegd debugdeltachain -m rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio 0 1 1 -1 base 104 135 104 0.77037 104 0 0.00000 1 1 2 0 p1 57 135 161 1.19259 161 0 0.00000 2 1 3 1 prev 57 135 218 1.61481 218 0 0.00000 3 1 2 0 p1 57 135 161 1.19259 275 114 0.70807 $ hg -R full debugdeltachain -m rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio 0 1 1 -1 base 104 135 104 0.77037 104 0 0.00000 1 1 2 0 p1 57 135 161 1.19259 161 0 0.00000 2 1 2 0 p1 57 135 161 1.19259 218 57 0.35404 3 1 2 0 p1 57 135 161 1.19259 275 114 0.70807 Test format.aggressivemergedeltas $ hg init --config format.generaldelta=1 aggressive $ cd aggressive $ cat << EOF >> .hg/hgrc > [format] > generaldelta = 1 > EOF $ touch a b c d e $ hg commit -Aqm side1 $ hg up -q null $ touch x y $ hg commit -Aqm side2 - Verify non-aggressive merge uses p1 (commit 1) as delta parent $ hg merge -q 0 $ hg commit -q -m merge $ hg debugdeltachain -m rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio 0 1 1 -1 base 59 215 59 0.27442 59 0 0.00000 1 1 2 0 prev 61 86 120 1.39535 120 0 0.00000 2 1 3 1 p1 65 301 185 0.61462 185 0 0.00000 $ hg strip -q -r . --config extensions.strip= - Verify aggressive merge uses p2 (commit 0) as delta parent $ hg up -q -C 1 $ hg merge -q 0 $ hg commit -q -m merge --config format.aggressivemergedeltas=True $ hg debugdeltachain -m rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio 0 1 1 -1 base 59 215 59 0.27442 59 0 0.00000 1 1 2 0 prev 61 86 120 1.39535 120 0 0.00000 2 1 2 0 p2 62 301 121 0.40199 182 61 0.50413 Test that strip bundle use bundle2 $ hg --config extensions.strip= strip . 0 files updated, 0 files merged, 5 files removed, 0 files unresolved saved backup bundle to $TESTTMP/aggressive/.hg/strip-backup/1c5d4dc9a8b8-6c68e60c-backup.hg $ hg debugbundle .hg/strip-backup/* Stream params: {Compression: BZ} changegroup -- {nbchanges: 1, version: 02} (mandatory: True) 1c5d4dc9a8b8d6e1750966d343e94db665e7a1e9 cache:rev-branch-cache -- {} (mandatory: False) phase-heads -- {} (mandatory: True) 1c5d4dc9a8b8d6e1750966d343e94db665e7a1e9 draft $ cd .. test maxdeltachainspan $ hg init source-repo $ cd source-repo $ hg debugbuilddag --new-file '.+5:brancha$.+11:branchb$.+30:branchc