mirror of
https://github.com/facebook/sapling.git
synced 2025-01-07 14:10:42 +03:00
effa0da8de
Summary: The helper could be used in individual tests to enable chg if chg exists. This allows us to have more precise control on what tests to use chg instead of using a global flag in run-tests.py. This makes certain tests containing many hg commands much faster. For example, `test-revset.t` took 99 seconds before: % ./run-tests.py test-revset.t --time . # Ran 1 tests, 0 skipped, 0 failed. # Producing time report start end cuser csys real Test 0.000 99.990 86.410 12.000 99.990 test-revset.t And 10 seconds after: % ./run-tests.py test-revset.t --time . # Ran 1 tests, 0 skipped, 0 failed. # Producing time report start end cuser csys real Test 0.000 10.080 0.380 0.130 10.080 test-revset.t Also enable it for some other tests. Note the whitelist is not complete. We probably want to whitelist more tests in the future. The feature could be opted out by deleting `contrib/chg/chg`. Reviewed By: phillco Differential Revision: D6767036 fbshipit-source-id: 8220cf408aa198d5d8e2ca5127ca60e2070d3444
121 lines
2.8 KiB
Perl
121 lines
2.8 KiB
Perl
$ . helpers-usechg.sh
|
|
|
|
Setup
|
|
|
|
$ cat >> $HGRCPATH <<EOF
|
|
> [ui]
|
|
> ssh = python "$RUNTESTDIR/dummyssh"
|
|
> username = nobody <no.reply@fb.com>
|
|
> [extensions]
|
|
> strip =
|
|
> remotenames =
|
|
> pushrebase =
|
|
> [experimental]
|
|
> evolution = createmarkers
|
|
> EOF
|
|
|
|
$ commit() {
|
|
> echo $1 > $1
|
|
> hg add $1
|
|
> hg commit -m "$1"
|
|
> }
|
|
|
|
$ log() {
|
|
> hg log -G -T "{desc} [{phase}:{rev}:{node|short}] {bookmarks}" "$@"
|
|
> }
|
|
|
|
Set up server repository
|
|
|
|
$ hg init server
|
|
$ cd server
|
|
$ commit base
|
|
$ hg book @
|
|
|
|
Set up client repository
|
|
|
|
$ cd ..
|
|
$ hg clone ssh://user@dummy/server client -q
|
|
$ cd client
|
|
|
|
Build commit graph to push in
|
|
|
|
$ hg up null
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
$ commit alpha
|
|
$ hg merge @
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
(branch merge, don't forget to commit)
|
|
$ hg commit -m "merge alpha"
|
|
$ hg up null
|
|
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
|
|
$ commit beta
|
|
$ hg merge @
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
(branch merge, don't forget to commit)
|
|
$ hg commit -m "merge beta"
|
|
$ hg merge 2
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
(branch merge, don't forget to commit)
|
|
$ hg commit -m "merge alpha and beta"
|
|
$ log
|
|
@ merge alpha and beta [draft:5:b41b83f633d8]
|
|
|\
|
|
| o merge beta [draft:4:45a8d60c53ab]
|
|
| |\
|
|
| | o beta [draft:3:4f90fdc3a1aa]
|
|
| |
|
|
o | merge alpha [draft:2:0fcb170b6d84]
|
|
|\|
|
|
o | alpha [draft:1:c85f9ce7b342]
|
|
/
|
|
o base [public:0:d20a80d4def3]
|
|
|
|
|
|
Add a commit in the server
|
|
|
|
$ cd ../server
|
|
$ commit other
|
|
$ log
|
|
@ other [draft:1:7fd651906bb3] @
|
|
|
|
|
o base [draft:0:d20a80d4def3]
|
|
|
|
|
|
Push in from the client.
|
|
|
|
$ cd ../client
|
|
$ hg push --to @
|
|
pushing rev b41b83f633d8 to destination ssh://user@dummy/server bookmark @
|
|
searching for changes
|
|
remote: pushing 5 changesets:
|
|
remote: c85f9ce7b342 alpha
|
|
remote: 0fcb170b6d84 merge alpha
|
|
remote: 4f90fdc3a1aa beta
|
|
remote: 45a8d60c53ab merge beta
|
|
remote: b41b83f633d8 merge alpha and beta
|
|
remote: 6 new changesets from the server will be downloaded
|
|
adding changesets
|
|
adding manifests
|
|
adding file changes
|
|
added 4 changesets with 1 changes to 3 files (+1 heads)
|
|
3 new obsolescence markers
|
|
updating bookmark @
|
|
obsoleted 3 changesets
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
$ log
|
|
@ merge alpha and beta [public:9:8c1abab9fd04]
|
|
|\
|
|
| o merge beta [public:8:f71e1c3a925c]
|
|
| |\
|
|
o---+ merge alpha [public:7:a9138cc95bb3]
|
|
| | |
|
|
| | o other [public:6:7fd651906bb3]
|
|
| | |
|
|
| o | beta [public:3:4f90fdc3a1aa]
|
|
| /
|
|
o / alpha [public:1:c85f9ce7b342]
|
|
/
|
|
o base [public:0:d20a80d4def3]
|
|
|
|
$ test -f other
|