Mercurial > hg
view tests/test-narrow-shallow.t @ 43256:00de32aa834e
copies: use an unfiltered repository for the changeset centric algorithm
Since the algorithm work form heads to ancestors, we don't need to check
filtering for anything but the two entries.
Using an unfiltered version is noticeably more efficient.
Some timing on the pypy repo:
revision: large amount; added files: large amount; rename small amount; c3b14617fbd7 9ba6ab77fd29
before: ! wall 2.717861 comb 2.720000 user 2.700000 sys 0.020000 (median of 10)
after: ! wall 2.582204 comb 2.580000 user 2.560000 sys 0.020000 (median of 10)
revision: large amount; added files: small amount; rename small amount; c3b14617fbd7 f650a9b140d2
before: ! wall 4.003146 comb 4.010000 user 3.970000 sys 0.040000 (median of 10)
after: ! wall 3.814613 comb 3.810000 user 3.760000 sys 0.050000 (median of 10)
revision: large amount; added files: large amount; rename large amount; 08ea3258278e d9fa043f30c0
before: ! wall 0.704204 comb 0.700000 user 0.700000 sys 0.000000 (median of 13)
after: ! wall 0.657387 comb 0.650000 user 0.640000 sys 0.010000 (best of 14)
revision: small amount; added files: large amount; rename large amount; df6f7a526b60 a83dc6a2d56f
before: ! wall 0.013493 comb 0.020000 user 0.020000 sys 0.000000 (median of 219)
after: ! wall 0.013523 comb 0.020000 user 0.020000 sys 0.000000 (median of 218)
revision: small amount; added files: large amount; rename small amount; 4aa4e1f8e19a 169138063d63
before: ! wall 0.003017 comb 0.000000 user 0.000000 sys 0.000000 (median of 985)
after: ! wall 0.002876 comb 0.000000 user 0.000000 sys 0.000000 (median of 1000)
revision: small amount; added files: small amount; rename small amount; 4bc173b045a6 964879152e2e
before: ! wall 0.000073 comb 0.000000 user 0.000000 sys 0.000000 (median of 12672)
after: ! wall 0.000082 comb 0.000000 user 0.000000 sys 0.000000 (median of 11456)
revision: medium amount; added files: large amount; rename medium amount; c95f1ced15f2 2c68e87c3efe
before: ! wall 0.478061 comb 0.470000 user 0.470000 sys 0.000000 (median of 19)
after: ! wall 0.452420 comb 0.450000 user 0.450000 sys 0.000000 (median of 21)
revision: medium amount; added files: medium amount; rename small amount; d343da0c55a8 d7746d32bf9d
before: ! wall 0.116015 comb 0.110000 user 0.110000 sys 0.000000 (median of 84)
after: ! wall 0.109153 comb 0.100000 user 0.100000 sys 0.000000 (median of 90)
Differential Revision: https://phab.mercurial-scm.org/D7123
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 15 Oct 2019 18:42:03 +0200 |
parents | 8d033b348d85 |
children | 34f2c634c8f6 |
line wrap: on
line source
#require no-reposimplestore $ . "$TESTDIR/narrow-library.sh" $ hg init master $ cd master $ cat >> .hg/hgrc <<EOF > [narrow] > serveellipses=True > EOF $ for x in `$TESTDIR/seq.py 10` > do > echo $x > "f$x" > hg add "f$x" > done $ hg commit -m "Add root files" $ mkdir d1 d2 $ for x in `$TESTDIR/seq.py 10` > do > echo d1/$x > "d1/f$x" > hg add "d1/f$x" > echo d2/$x > "d2/f$x" > hg add "d2/f$x" > done $ hg commit -m "Add d1 and d2" $ for x in `$TESTDIR/seq.py 10` > do > echo f$x rev2 > "f$x" > echo d1/f$x rev2 > "d1/f$x" > echo d2/f$x rev2 > "d2/f$x" > hg commit -m "Commit rev2 of f$x, d1/f$x, d2/f$x" > done $ cd .. narrow and shallow clone the d2 directory $ hg clone --narrow ssh://user@dummy/master shallow --include "d2" --depth 2 requesting all changes adding changesets adding manifests adding file changes added 4 changesets with 13 changes to 10 files new changesets *:* (glob) updating to branch default 10 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd shallow $ hg log -T '{rev}{if(ellipsis,"...")}: {desc}\n' 3: Commit rev2 of f10, d1/f10, d2/f10 2: Commit rev2 of f9, d1/f9, d2/f9 1: Commit rev2 of f8, d1/f8, d2/f8 0...: Commit rev2 of f7, d1/f7, d2/f7 $ hg update 0 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat d2/f7 d2/f8 d2/f7 rev2 d2/8 $ cd .. change every upstream file once $ cd master $ for x in `$TESTDIR/seq.py 10` > do > echo f$x rev3 > "f$x" > echo d1/f$x rev3 > "d1/f$x" > echo d2/f$x rev3 > "d2/f$x" > hg commit -m "Commit rev3 of f$x, d1/f$x, d2/f$x" > done $ cd .. pull new changes with --depth specified. There were 10 changes to the d2 directory but the shallow pull should only fetch 3. $ cd shallow $ hg pull --depth 2 pulling from ssh://user@dummy/master searching for changes adding changesets adding manifests adding file changes added 4 changesets with 10 changes to 10 files new changesets *:* (glob) (run 'hg update' to get a working copy) $ hg log -T '{rev}{if(ellipsis,"...")}: {desc}\n' 7: Commit rev3 of f10, d1/f10, d2/f10 6: Commit rev3 of f9, d1/f9, d2/f9 5: Commit rev3 of f8, d1/f8, d2/f8 4...: Commit rev3 of f7, d1/f7, d2/f7 3: Commit rev2 of f10, d1/f10, d2/f10 2: Commit rev2 of f9, d1/f9, d2/f9 1: Commit rev2 of f8, d1/f8, d2/f8 0...: Commit rev2 of f7, d1/f7, d2/f7 $ hg update 4 merging d2/f1 merging d2/f2 merging d2/f3 merging d2/f4 merging d2/f5 merging d2/f6 merging d2/f7 3 files updated, 7 files merged, 0 files removed, 0 files unresolved $ cat d2/f7 d2/f8 d2/f7 rev3 d2/f8 rev2 $ hg update 7 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat d2/f10 d2/f10 rev3 $ cd .. cannot clone with zero or negative depth $ hg clone --narrow ssh://user@dummy/master bad --include "d2" --depth 0 requesting all changes remote: abort: depth must be positive, got 0 abort: pull failed on remote [255] $ hg clone --narrow ssh://user@dummy/master bad --include "d2" --depth -1 requesting all changes remote: abort: depth must be positive, got -1 abort: pull failed on remote [255]