##// END OF EJS Templates
bisect: avoid adding irrelevant revisions to bisect state...
bisect: avoid adding irrelevant revisions to bisect state When adding new revisions to the bisect state, it only makes sense to add information about revisions that are under consideration (i.e., those that are topologically between the known good and bad revisions). However, if the user passes in a revset (e.g., '!merge()' to exclude merge commits), hg will resolve the revset first and add all matching revisions to the bisect state (which in this case would likely be the majority of revisions in the repo). To avoid this, revisions should only be added to the bisect state if they are between the good and bad revisions (and therefore relevant to the bisection). -- Here are the results of some performance tests using the `mozilla-central` repo (since it is one of the largest freely-available hg repositories in the wild). These tests compare the performance of a locally-built `hg` before and after application of this series. Note that `--noupdate` is passed to avoid including update time (which should not vary across cases). Setup (run between each test): $ hg bisect --reset $ hg bisect --noupdate --bad 56c3ad4bde5c70714b784ccf15d099e0df0f5bde $ hg bisect --noupdate --good 57426696adaf08298af3027fa77486fee0633b13 Test using a revset that returns a very large number of revisions: $ time hg bisect --noupdate --skip '!merge()' > /dev/null Before: real 0m9.398s user 0m9.233s sys 0m0.120s After: real 0m1.513s user 0m1.425s sys 0m0.052s Test using a revset that is expensive to compute: $ time hg bisect --noupdate --skip 'desc("Bug")' > /dev/null Before: real 0m49.853s user 0m49.580s sys 0m0.243s After: real 0m4.120s user 0m4.036s sys 0m0.048s

File last commit:

r50161:da3e37ec default
r50337:81623652 default
Show More
test-sidedata.t
82 lines | 4.1 KiB | text/troff | Tads3Lexer
==========================================================
Test file dedicated to checking side-data related behavior
==========================================================
Check data can be written/read from sidedata
============================================
$ cat << EOF >> $HGRCPATH
> [extensions]
> testsidedata=$TESTDIR/testlib/ext-sidedata.py
> EOF
$ hg init test-sidedata --config experimental.revlogv2=enable-unstable-format-and-corrupt-my-data
$ cd test-sidedata
$ echo aaa > a
$ hg add a
$ hg commit -m a --traceback
$ echo aaa > b
$ hg add b
$ hg commit -m b
$ echo xxx >> a
$ hg commit -m aa
$ hg debugsidedata -c 0
2 sidedata entries
entry-0001 size 4
entry-0002 size 32
$ hg debugsidedata -c 1 -v
2 sidedata entries
entry-0001 size 4
'\x00\x00\x006'
entry-0002 size 32
'\x98\t\xf9\xc4v\xf0\xc5P\x90\xf7wRf\xe8\xe27e\xfc\xc1\x93\xa4\x96\xd0\x1d\x97\xaaG\x1d\xd7t\xfa\xde'
$ hg debugsidedata -m 2
2 sidedata entries
entry-0001 size 4
entry-0002 size 32
$ hg debugsidedata a 1
2 sidedata entries
entry-0001 size 4
entry-0002 size 32
$ hg debug-revlog-index --verbose -c
rev rank linkrev nodeid p1-rev p1-nodeid p2-rev p2-nodeid full-size delta-base flags comp-mode data-offset chunk-size sd-comp-mode sidedata-offset sd-chunk-size
0 -1 0 7049e48789d7 -1 000000000000 -1 000000000000 54 0 0 0 0 54 plain 0 90
1 -1 1 2707720c6597 0 7049e48789d7 -1 000000000000 54 1 0 0 54 54 plain 90 90
2 -1 2 40f977031323 1 2707720c6597 -1 000000000000 55 2 0 0 108 55 plain 180 90
$ hg debug-revlog-index --verbose -m
rev rank linkrev nodeid p1-rev p1-nodeid p2-rev p2-nodeid full-size delta-base flags comp-mode data-offset chunk-size sd-comp-mode sidedata-offset sd-chunk-size
0 -1 0 b85d294330e3 -1 000000000000 -1 000000000000 43 0 0 0 0 43 plain 0 90
1 -1 1 1a0aec305c63 0 b85d294330e3 -1 000000000000 86 0 0 0 43 55 plain 90 90
2 -1 2 104258a4f75f 1 1a0aec305c63 -1 000000000000 86 1 0 0 98 55 plain 180 90
Check upgrade behavior
======================
Right now, sidedata has not upgrade support
Check that we can upgrade to sidedata
-------------------------------------
$ hg init up-no-side-data --config experimental.revlogv2=no
$ hg debugformat -v -R up-no-side-data | egrep 'changelog-v2|revlog-v2'
revlog-v2: no no no
changelog-v2: no no no
$ hg debugformat -v -R up-no-side-data --config experimental.revlogv2=enable-unstable-format-and-corrupt-my-data | egrep 'changelog-v2|revlog-v2'
revlog-v2: no yes no
changelog-v2: no no no
$ hg debugupgraderepo -R up-no-side-data --config experimental.revlogv2=enable-unstable-format-and-corrupt-my-data > /dev/null
Check that we can downgrade from sidedata
-----------------------------------------
$ hg init up-side-data --config experimental.revlogv2=enable-unstable-format-and-corrupt-my-data
$ hg debugformat -v -R up-side-data | egrep 'changelog-v2|revlog-v2'
revlog-v2: yes no no
changelog-v2: no no no
$ hg debugformat -v -R up-side-data --config experimental.revlogv2=no | egrep 'changelog-v2|revlog-v2'
revlog-v2: yes no no
changelog-v2: no no no
$ hg debugupgraderepo -R up-side-data --config experimental.revlogv2=no > /dev/null