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

r46518:95c4cca6 default
r50337:81623652 default
Show More
test-identify.t
175 lines | 3.5 KiB | text/troff | Tads3Lexer
Matt Mackall
tests: replace exit 80 with #require
r22046 #require serve
Mads Kiilerich
tests: convert some 'hghave no-outer-repo' to #if...
r17014
#if no-outer-repo
Nicolas Dumazet
tests: unify test-identify
r11796
no repo
$ hg id
Martin Geisler
Merge with stable
r12070 abort: there is no Mercurial repository here (.hg not found)
Martin von Zweigbergk
errors: introduce InputError and use it from commands and cmdutil...
r46431 [10]
Nicolas Dumazet
tests: unify test-identify
r11796
Mads Kiilerich
tests: convert some 'hghave no-outer-repo' to #if...
r17014 #endif
Nicolas Dumazet
tests: unify test-identify
r11796 create repo
$ hg init test
$ cd test
$ echo a > a
$ hg ci -Ama
adding a
basic id usage
$ hg id
cb9a9f314b8b tip
$ hg id --debug
cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b tip
$ hg id -q
cb9a9f314b8b
$ hg id -v
cb9a9f314b8b tip
with options
$ hg id -r.
cb9a9f314b8b tip
$ hg id -n
0
$ hg id -t
tip
$ hg id -b
default
$ hg id -i
cb9a9f314b8b
$ hg id -n -t -b -i
cb9a9f314b8b 0 default tip
Matt Harbison
identify: add template support...
r33051 $ hg id -Tjson
[
{
"bookmarks": [],
"branch": "default",
Matt Harbison
identify: rename 'changed' keyword -> 'dirty'...
r33054 "dirty": "",
Yuya Nishihara
identify: use fm.hexfunc thoroughly...
r39661 "id": "cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b",
Matt Harbison
identify: add template support...
r33051 "node": "ffffffffffffffffffffffffffffffffffffffff",
Yuya Nishihara
identify: change {parents} to a list of nodes (BC)...
r39662 "parents": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"],
Matt Harbison
identify: add template support...
r33051 "tags": ["tip"]
}
]
Nicolas Dumazet
tests: unify test-identify
r11796
Yuya Nishihara
identify: provide changectx to templater
r33091 test template keywords and functions which require changectx:
$ hg id -T '{rev} {node|shortest}\n'
2147483647 ffff
$ hg id -T '{parents % "{rev} {node|shortest} {desc}\n"}'
0 cb9a a
Yuya Nishihara
formatter: make nested items somewhat readable in template output
r37518 $ hg id -T '{parents}\n'
Yuya Nishihara
identify: change {parents} to a list of nodes (BC)...
r39662 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
Yuya Nishihara
identify: provide changectx to templater
r33091
Yuya Nishihara
templater: drop symbols which should be overridden by new 'ctx' (issue5612)...
r37093 test nested template: '{tags}'/'{node}' constants shouldn't override the
default keywords, but '{id}' persists because there's no default keyword
for '{id}' (issue5612)
$ hg id -T '{tags}\n'
tip
Yuya Nishihara
identify: use fm.hexfunc thoroughly...
r39661 $ hg id -T '{revset("null:.") % "{rev}:{node|short} {tags} {id|short}\n"}'
Yuya Nishihara
templater: drop symbols which should be overridden by new 'ctx' (issue5612)...
r37093 -1:000000000000 cb9a9f314b8b
0:cb9a9f314b8b tip cb9a9f314b8b
Nicolas Dumazet
tests: unify test-identify
r11796 with modifications
$ echo b > a
$ hg id -n -t -b -i
cb9a9f314b8b+ 0+ default tip
Matt Harbison
identify: add template support...
r33051 $ hg id -Tjson
[
{
"bookmarks": [],
"branch": "default",
Matt Harbison
identify: rename 'changed' keyword -> 'dirty'...
r33054 "dirty": "+",
Yuya Nishihara
identify: use fm.hexfunc thoroughly...
r39661 "id": "cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b+",
Matt Harbison
identify: add template support...
r33051 "node": "ffffffffffffffffffffffffffffffffffffffff",
Yuya Nishihara
identify: change {parents} to a list of nodes (BC)...
r39662 "parents": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"],
Matt Harbison
identify: add template support...
r33051 "tags": ["tip"]
}
]
Nicolas Dumazet
tests: unify test-identify
r11796
other local repo
$ cd ..
$ hg -R test id
cb9a9f314b8b+ tip
Mads Kiilerich
tests: convert some 'hghave no-outer-repo' to #if...
r17014 #if no-outer-repo
Nicolas Dumazet
tests: unify test-identify
r11796 $ hg id test
cb9a9f314b8b+ tip
Mads Kiilerich
tests: convert some 'hghave no-outer-repo' to #if...
r17014 #endif
Nicolas Dumazet
tests: unify test-identify
r11796
with remote http repo
$ cd test
$ hg serve -p $HGPORT1 -d --pid-file=hg.pid
$ cat hg.pid >> $DAEMON_PIDS
$ hg id http://localhost:$HGPORT1/
cb9a9f314b8b
Kevin Bullock
id: add bookmarks to id...
r13477 remote with rev number?
$ hg id -n http://localhost:$HGPORT1/
Nils Adermann
identify: list bookmarks for remote repositories
r13644 abort: can't query remote revision number, branch, or tags
Martin von Zweigbergk
errors: introduce InputError and use it from commands and cmdutil...
r46431 [10]
Kevin Bullock
id: add bookmarks to id...
r13477
Nicolas Dumazet
tests: unify test-identify
r11796 remote with tags?
$ hg id -t http://localhost:$HGPORT1/
Nils Adermann
identify: list bookmarks for remote repositories
r13644 abort: can't query remote revision number, branch, or tags
Martin von Zweigbergk
errors: introduce InputError and use it from commands and cmdutil...
r46431 [10]
Kevin Bullock
id: add bookmarks to id...
r13477
remote with branch?
$ hg id -b http://localhost:$HGPORT1/
Nils Adermann
identify: list bookmarks for remote repositories
r13644 abort: can't query remote revision number, branch, or tags
Martin von Zweigbergk
errors: introduce InputError and use it from commands and cmdutil...
r46431 [10]
Adrian Buehlmann
introduce new RequirementError (issue2649)...
r13447
David Soria Parra
tests: add tests for bookmarks support in hg identify
r13645 test bookmark support
$ hg bookmark Y
$ hg bookmark Z
$ hg bookmarks
Y 0:cb9a9f314b8b
* Z 0:cb9a9f314b8b
$ hg id
cb9a9f314b8b+ tip Y/Z
$ hg id --bookmarks
Y Z
test remote identify with bookmarks
$ hg id http://localhost:$HGPORT1/
cb9a9f314b8b Y/Z
$ hg id --bookmarks http://localhost:$HGPORT1/
Y Z
$ hg id -r . http://localhost:$HGPORT1/
cb9a9f314b8b Y/Z
$ hg id --bookmarks -r . http://localhost:$HGPORT1/
Y Z
Mads Kiilerich
httppeer: reintroduce _abort that accidentally was removed in 167047ba3cfa...
r21188 test invalid lookup
$ hg id -r noNoNO http://localhost:$HGPORT1/
Martin von Zweigbergk
errors: remove trailing "!" from some error messages for consistency...
r46518 abort: unknown revision 'noNoNO'
Mads Kiilerich
httppeer: reintroduce _abort that accidentally was removed in 167047ba3cfa...
r21188 [255]
Adrian Buehlmann
introduce new RequirementError (issue2649)...
r13447 Make sure we do not obscure unknown requires file entries (issue2649)
$ echo fake >> .hg/requires
$ hg id
Martin von Zweigbergk
errors: remove trailing "!" from some error messages for consistency...
r46518 abort: repository requires features unknown to this Mercurial: fake
Matt Mackall
urls: bulk-change primary website URLs
r26421 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
Adrian Buehlmann
introduce new RequirementError (issue2649)...
r13447 [255]
$ cd ..
Mads Kiilerich
tests: convert some 'hghave no-outer-repo' to #if...
r17014 #if no-outer-repo
Adrian Buehlmann
introduce new RequirementError (issue2649)...
r13447 $ hg id test
Martin von Zweigbergk
errors: remove trailing "!" from some error messages for consistency...
r46518 abort: repository requires features unknown to this Mercurial: fake
Matt Mackall
urls: bulk-change primary website URLs
r26421 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
Adrian Buehlmann
introduce new RequirementError (issue2649)...
r13447 [255]
Mads Kiilerich
tests: convert some 'hghave no-outer-repo' to #if...
r17014 #endif