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

r49592:18e69f22 default
r50337:81623652 default
Show More
test-narrow-merge-outside.t
111 lines | 4.4 KiB | text/troff | Tads3Lexer
/ tests / test-narrow-merge-outside.t
===================================================================
Test merge behavior with narrow for item outside of the narrow spec
===================================================================
This test currently check for simple "outside of narrow" merge case. I suspect
there might be more corner case that need testing, so extending this tests, or
replacing it by a more "generative" version, comparing behavior with and without narow.
This the feature is currently working with flat manifest only. This is the only
case tested. Consider using test-case if tree start supporting this case of
merge.
Create some initial setup
$ . "$TESTDIR/narrow-library.sh"
$ hg init server
$ echo root > server/root
$ mkdir server/inside
$ mkdir server/outside
$ echo babar > server/inside/inside-change
$ echo pom > server/outside/outside-changing
$ echo arthur > server/outside/outside-removed
$ hg -R server add server/
adding server/inside/inside-change
adding server/outside/outside-changing
adding server/outside/outside-removed
adding server/root
$ hg -R server commit -m root
$ hg clone ssh://user@dummy/server client --narrow --include inside
requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
new changesets a0c415d360e5
updating to branch default
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
"trivial" change outside of narrow spec on the server
$ echo zephir > server/outside/outside-added
$ hg -R server add server/outside/outside-added
$ echo flore > server/outside/outside-changing
$ hg -R server remove server/outside/outside-removed
$ hg -R server commit -m "outside change"
Merge them with some unrelated local change
$ echo celeste > client/inside/inside-change
$ hg -R client commit -m "inside change"
$ hg -R client pull
pulling from ssh://user@dummy/server
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 0 changes to 0 files (+1 heads)
new changesets f9ec5453023e
(run 'hg heads' to see heads, 'hg merge' to merge)
$ hg -R client merge
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ hg -R client ci -m 'merge changes'
$ hg -R client push -r .
pushing to ssh://user@dummy/server
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 2 changesets with 1 changes to 1 files
Checking result
---------------
general sentry of all output
$ hg --repository server manifest --debug --rev 0
360afd990eeff79e4a7f9f3ded5ecd7bc2fd3b59 644 inside/inside-change
7db95ce5cd8e734ad12e3f5f37779a08070a1399 644 outside/outside-changing
1591f6db41a30b68bd94ddccf4a4ce4f4fbe2a44 644 outside/outside-removed
50ecbc31c0e82dd60c2747c434d1f11b85c0e178 644 root
$ hg --repository server manifest --debug --rev 1
360afd990eeff79e4a7f9f3ded5ecd7bc2fd3b59 644 inside/inside-change
486c008d6dddcaeb5e5f99556a121800cdcfb149 644 outside/outside-added
153d7af5e4f53f44475bc0ff2b806c86f019eda4 644 outside/outside-changing
50ecbc31c0e82dd60c2747c434d1f11b85c0e178 644 root
$ hg --repository server manifest --debug --rev 2
1b3ab69c6c847abc8fd25537241fedcd4d188668 644 inside/inside-change
7db95ce5cd8e734ad12e3f5f37779a08070a1399 644 outside/outside-changing
1591f6db41a30b68bd94ddccf4a4ce4f4fbe2a44 644 outside/outside-removed
50ecbc31c0e82dd60c2747c434d1f11b85c0e178 644 root
$ hg --repository server manifest --debug --rev 3
1b3ab69c6c847abc8fd25537241fedcd4d188668 644 inside/inside-change
486c008d6dddcaeb5e5f99556a121800cdcfb149 644 outside/outside-added
153d7af5e4f53f44475bc0ff2b806c86f019eda4 644 outside/outside-changing
50ecbc31c0e82dd60c2747c434d1f11b85c0e178 644 root
The file changed outside should be changed by the merge
$ hg --repository server manifest --debug --rev 'desc("inside change")' | grep outside-changing
7db95ce5cd8e734ad12e3f5f37779a08070a1399 644 outside/outside-changing
$ hg --repository server manifest --debug --rev 'desc("outside change")' | grep outside-changing
153d7af5e4f53f44475bc0ff2b806c86f019eda4 644 outside/outside-changing
$ hg --repository server manifest --debug --rev 'desc("merge")' | grep outside-changing
153d7af5e4f53f44475bc0ff2b806c86f019eda4 644 outside/outside-changing