##// 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:

r49505:6dde44bb default
r50337:81623652 default
Show More
test-revlog-v2.t
132 lines | 3.2 KiB | text/troff | Tads3Lexer
Gregory Szorc
tests: disable test-revlog-v2 when using simple store...
r37363 #require reporevlogstore
Gregory Szorc
revlog: skeleton support for version 2 revlogs...
r32697 A repo with unknown revlogv2 requirement string cannot be opened
$ hg init invalidreq
$ cd invalidreq
$ echo exp-revlogv2.unknown >> .hg/requires
$ hg log
Martin von Zweigbergk
errors: remove trailing "!" from some error messages for consistency...
r46518 abort: repository requires features unknown to this Mercurial: exp-revlogv2.unknown
Gregory Szorc
revlog: skeleton support for version 2 revlogs...
r32697 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
[255]
$ cd ..
Can create and open repo with revlog v2 requirement
$ cat >> $HGRCPATH << EOF
> [experimental]
> revlogv2 = enable-unstable-format-and-corrupt-my-data
> EOF
revlogv2: also test that local clone works...
r48242 $ hg init new-repo
$ cd new-repo
test: simpler requirement matching in test-revlog-v2.t...
r49505 $ hg debugrequires | grep revlogv2
Raphaël Gomès
revlog: introduce v2 format...
r47438 exp-revlogv2.2
test: simpler requirement matching in test-revlog-v2.t...
r49505 dirstate-v2 (dirstate-v2 !)
Gregory Szorc
revlog: skeleton support for version 2 revlogs...
r32697
$ hg log
Unknown flags to revlog are rejected
>>> with open('.hg/store/00changelog.i', 'wb') as fh:
Joerg Sonnenberger
tests: make flag parsing test more future safe...
r45929 ... fh.write(b'\xff\x00\xde\xad') and None
Gregory Szorc
revlog: skeleton support for version 2 revlogs...
r32697
$ hg log
revlog: use revlog.display_id in format related errors...
r47928 abort: unknown flags (0xff00) in version 57005 revlog 00changelog
Martin von Zweigbergk
errors: use detailed exit code 50 for StorageError...
r46732 [50]
Gregory Szorc
revlog: skeleton support for version 2 revlogs...
r32697
$ cd ..
Writing a simple revlog v2 works
$ hg init simple
$ cd simple
$ touch foo
$ hg -q commit -A -m initial
$ hg log
changeset: 0:96ee1d7354c4
tag: tip
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: initial
revlogv2: use a unique filename for data...
r48115
Gregory Szorc
revlog: always enable generaldelta on version 2 revlogs...
r41238 Header written as expected
Gregory Szorc
revlog: skeleton support for version 2 revlogs...
r32697
$ f --hexdump --bytes 4 .hg/store/00changelog.i
.hg/store/00changelog.i:
revlogv2: no longer attempt to use inline for new revlog...
r48035 0000: 00 00 de ad |....|
Gregory Szorc
revlog: skeleton support for version 2 revlogs...
r32697
$ f --hexdump --bytes 4 .hg/store/data/foo.i
.hg/store/data/foo.i:
revlogv2: no longer attempt to use inline for new revlog...
r48035 0000: 00 00 de ad |....|
revlogv2: use a unique filename for index...
r48114
revlogv2: make sure bundling pick a compatible bundle format...
r48133 Bundle use a compatible changegroup format
------------------------------------------
$ hg bundle --all ../basic.hg
1 changesets found
$ hg debugbundle --spec ../basic.hg
bzip2-v2
revlogv2: use a unique filename for index...
r48114 The expected files are generated
--------------------------------
We should have have:
- a docket
- a index file with a unique name
- a data file
$ ls .hg/store/00changelog* .hg/store/00manifest*
revlog: store sidedata in their own file...
r48181 .hg/store/00changelog-1335303a.sda
.hg/store/00changelog-6b8ab34b.idx
.hg/store/00changelog-b875dfc5.dat
revlogv2: use a unique filename for index...
r48114 .hg/store/00changelog.i
revlog: store sidedata in their own file...
r48181 .hg/store/00manifest-05a21d65.idx
.hg/store/00manifest-43c37dde.dat
.hg/store/00manifest-e2c9362a.sda
revlogv2: use a unique filename for index...
r48114 .hg/store/00manifest.i
revlogv2: also test that local clone works...
r48242
Local clone works
-----------------
$ hg clone . ../cloned-repo
updating to branch default
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg tip | tee ../tip-new
changeset: 0:96ee1d7354c4
tag: tip
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: initial
$ hg tip -R ../cloned-repo | tee ../tip-cloned
changeset: 0:96ee1d7354c4
tag: tip
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: initial
The two repository should be identical, this diff MUST be empty
$ cmp ../tip-new ../tip-cloned || diff -U8 ../tip-new ../tip-cloned
revlogv2: fix `hg verify` with revlog v2...
r48243
hg verify should be happy
-------------------------
$ hg verify
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
checked 1 changesets with 1 changes to 1 files
$ hg verify -R ../cloned-repo
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
checked 1 changesets with 1 changes to 1 files