Mercurial > hg
view tests/test-subrepo-relative-path.t @ 41277:61f9ef23a12f
dagop: minor python optimization to `headrevs`
Less lookup and less function call never hurt. This provides a small speedup
on various run of the 'heads()' revset. This also buys back some of the slow
down we observed in the previous changesets for single value lookup.
Performance number:
0) before dagop.headrevs usage
1) after dagop.headrevs usage
2) after this change
revset: heads(all())
plain min max first last reverse rev..rst rev..ast sort sor..rst sor..ast
0) 0.036503 0.032564 0.030024 0.032378 0.030887 0.036367 0.031713 0.032205 0.036467 0.032286 0.030300
1) 0.036668 0.035347 108% 0.035611 118% 0.035358 109% 0.035726 115% 0.036411 0.035261 111% 0.036096 112% 0.036052 0.035095 108% 0.035792 118%
2) 0.034254 93% 0.034482 0.035003 0.034353 0.033754 94% 0.034689 0.034361 0.035059 0.034636 0.034662 0.035465
revset: heads(-10000:-1)
plain min max first last reverse rev..rst rev..ast sort sor..rst sor..ast
0) 0.003936 0.003218 0.003227 0.003302 0.003328 0.003848 0.003305 0.003252 0.003839 0.003306 0.003279
1) 0.003870 0.003785 117% 0.003821 118% 0.003780 114% 0.003769 113% 0.003776 0.003792 114% 0.003805 117% 0.003810 0.003798 114% 0.003840 117%
2) 0.003666 94% 0.003577 94% 0.003632 0.003644 0.003614 0.003638 0.003652 0.003632 0.003661 0.003660 0.003658
revset: (-5000:-1000) and heads(-10000:-1)
plain min max first last reverse rev..rst rev..ast sort sor..rst sor..ast
0) 0.004244 0.003368 0.003313 0.003367 0.003327 0.004325 0.003401 0.003379 0.004310 0.003359 0.003396
1) 0.003969 93% 0.003862 114% 0.003834 115% 0.003810 113% 0.003822 114% 0.003940 91% 0.003908 114% 0.003814 112% 0.003986 92% 0.003954 117% 0.003816 112%
2) 0.003728 93% 0.003638 94% 0.003659 0.003685 0.003628 94% 0.003716 94% 0.003653 93% 0.003655 0.003748 94% 0.003740 94% 0.003686
revset: heads(matching(tip, "author"))
plain min max first last reverse rev..rst rev..ast sort sor..rst sor..ast
0) 7.574666 7.545950 7.570743 7.578697 7.525725 7.509929 7.443854 7.488442 7.452880 7.445411 7.689107
1) 7.549390 7.389162 7.529790 7.536297 7.450467 7.555347 7.404586 7.514948 7.542794 7.524787 7.536918
2) 7.568294 7.479326 7.578624 7.380375 7.440102 7.454218 7.515189 7.556511 7.524585 7.537566 7.507418
revset: heads(matching(tip, "author")) and -10000:-1
plain min max first last reverse rev..rst rev..ast sort sor..rst sor..ast
0) 7.512533 7.605877 7.382894 7.462109 7.420086 7.575034 7.448452 7.549374 7.457880 7.450308 7.515019
1) 7.548677 7.551832 7.629598 7.494857 7.550554 7.521838 7.451794 error 7.321781 7.546885 7.557523
2) 7.451985 7.541044 7.506563 7.470928 7.512618 7.474988 7.498887 7.547930 7.560276 7.618599 7.465442
revset: (-10000:-1) and heads(matching(tip, "author"))
plain min max first last reverse rev..rst rev..ast sort sor..rst sor..ast
0) 7.465419 7.570089 7.439594 7.521221 7.498716 7.492922 7.479108 7.552397 7.407888 error 7.468264
1) 7.539866 7.548045 7.491761 7.517170 7.469824 7.501990 7.579102 7.502568 7.578102 7.555754 7.567622
2) 7.370463 7.514712 7.497024 7.679428 7.638138 7.490775 7.472273 7.652587 7.584139 7.511893 7.466384
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Mon, 14 Jan 2019 17:15:21 +0100 |
parents | 41ac8ea1bdd7 |
children | ebee234d952a |
line wrap: on
line source
Preparing the subrepository 'sub' $ hg init sub $ echo sub > sub/sub $ hg add -R sub adding sub/sub $ hg commit -R sub -m "sub import" Preparing the 'main' repo which depends on the subrepo 'sub' $ hg init main $ echo main > main/main $ echo "sub = ../sub" > main/.hgsub $ hg clone sub main/sub updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg add -R main adding main/.hgsub adding main/main $ hg commit -R main -m "main import" Cleaning both repositories, just as a clone -U $ hg up -C -R sub null 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg up -C -R main null 0 files updated, 0 files merged, 3 files removed, 0 files unresolved $ rm -rf main/sub hide outer repo $ hg init Serving them both using hgweb $ printf '[paths]\n/main = main\nsub = sub\n' > webdir.conf $ hg serve --webdir-conf webdir.conf -a localhost -p $HGPORT \ > -A /dev/null -E /dev/null --pid-file hg.pid -d $ cat hg.pid >> $DAEMON_PIDS Clone main from hgweb $ hg clone "http://user:pass@localhost:$HGPORT/main" cloned requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 3 changes to 3 files new changesets fdfeeb3e979e updating to branch default cloning subrepo sub from http://user@localhost:$HGPORT/sub requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 863c1745b441 3 files updated, 0 files merged, 0 files removed, 0 files unresolved Ensure that subrepos pay attention to default:pushurl $ cat > cloned/.hg/hgrc << EOF > [paths] > default:pushurl = http://user:pass@localhost:$HGPORT/main > EOF $ hg -R cloned out -S --config paths.default=bogus://invalid comparing with http://user:***@localhost:$HGPORT/main searching for changes no changes found comparing with http://user:***@localhost:$HGPORT/sub searching for changes no changes found [1] TODO: Figure out why, if the password is left out of the default:pushurl URL, this says "no changes made to subrepo sub since last push". It looks like from the original clone command above, the password is getting stripped off, not just masked out, and that would make the hashed URL different. $ hg -R cloned push --config paths.default=bogus://invalid pushing to http://user:***@localhost:$HGPORT/main pushing subrepo sub to http://user:***@localhost:$HGPORT/sub searching for changes no changes found searching for changes no changes found abort: HTTP Error 403: ssl required [255] Checking cloned repo ids $ hg id -R cloned fdfeeb3e979e tip $ hg id -R cloned/sub 863c1745b441 tip subrepo debug for 'main' clone $ hg debugsub -R cloned path sub source ../sub revision 863c1745b441bd97a8c4a096e87793073f4fb215 Test sharing with a remote URL reference $ hg init absolute_subrepo $ cd absolute_subrepo $ echo foo > foo.txt $ hg ci -Am 'initial commit' adding foo.txt $ echo "sub = http://localhost:$HGPORT/sub" > .hgsub $ hg ci -Am 'add absolute subrepo' adding .hgsub $ cd .. Clone pooling works for local clones with a remote subrepo reference. The subrepo is cloned to the pool and shared from there, so that all clones will share the same subrepo. $ hg --config extensions.share= --config share.pool=$TESTTMP/pool \ > clone absolute_subrepo cloned_from_abs (sharing from new pooled repository 8d6a2f1e993b34b6557de0042cfe825ae12a8dae) requesting all changes adding changesets adding manifests adding file changes added 2 changesets with 3 changes to 3 files new changesets 8d6a2f1e993b:* (glob) searching for changes no changes found updating working directory cloning subrepo sub from http://localhost:$HGPORT/sub (sharing from new pooled repository 863c1745b441bd97a8c4a096e87793073f4fb215) requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 863c1745b441 searching for changes no changes found 3 files updated, 0 files merged, 0 files removed, 0 files unresolved Vanilla sharing with a subrepo remote path reference will clone the subrepo. Each share of these top level repos will end up with independent subrepo copies (potentially leaving the shared parent with dangling cset references). $ hg --config extensions.share= share absolute_subrepo shared_from_abs updating working directory cloning subrepo sub from http://localhost:$HGPORT/sub requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 863c1745b441 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg --config extensions.share= share -U absolute_subrepo shared_from_abs2 $ hg -R shared_from_abs2 update -r tip cloning subrepo sub from http://localhost:$HGPORT/sub requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 863c1745b441 3 files updated, 0 files merged, 0 files removed, 0 files unresolved A parent repo without its subrepo available locally can be shared if the subrepo is referenced by absolute path. $ hg clone -U absolute_subrepo cloned_null_from_abs $ hg --config extensions.share= share cloned_null_from_abs shared_from_null_abs updating working directory cloning subrepo sub from http://localhost:$HGPORT/sub requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 863c1745b441 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ killdaemons.py subrepo paths with ssh urls $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/cloned sshclone requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 3 changes to 3 files new changesets fdfeeb3e979e updating to branch default cloning subrepo sub from ssh://user@dummy/sub requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 863c1745b441 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -R sshclone push -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/`pwd`/cloned pushing to ssh://user@dummy/$TESTTMP/cloned pushing subrepo sub to ssh://user@dummy/$TESTTMP/sub searching for changes no changes found searching for changes no changes found [1] $ cat dummylog Got arguments 1:user@dummy 2:hg -R cloned serve --stdio Got arguments 1:user@dummy 2:hg -R sub serve --stdio Got arguments 1:user@dummy 2:hg -R $TESTTMP/cloned serve --stdio Got arguments 1:user@dummy 2:hg -R $TESTTMP/sub serve --stdio