Mercurial > hg
annotate tests/library-infinitepush.sh @ 42742:334c1ea57136
discovery: new devel.discovery.randomize option
By default, this is True, but setting it to False is a uniform
way to kill all randomness in integration tests such as test-setdiscovery.t
By "uniform" we mean that it can be passed to implementations in other
languages, for which the monkey-patching of random.sample would be
irrelevant.
In the above mentioned test file, we use it right away,
replacing the adhoc extension that had the same purpose, and to derandomize a
case with many round-trips, that we'll need to behave uniformly in the Rust
version.
Differential Revision: https://phab.mercurial-scm.org/D6427
author | Georges Racinet <georges.racinet@octobus.net> |
---|---|
date | Tue, 21 May 2019 17:44:15 +0200 |
parents | 03ff17a4bf53 |
children | 0826d684a1b5 |
rev | line source |
---|---|
37187
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
1 scratchnodes() { |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
2 for node in `find ../repo/.hg/scratchbranches/index/nodemap/* | sort`; do |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
3 echo ${node##*/} `cat $node` |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
4 done |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
5 } |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
6 |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
7 scratchbookmarks() { |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
8 for bookmark in `find ../repo/.hg/scratchbranches/index/bookmarkmap/* -type f | sort`; do |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
9 echo "${bookmark##*/bookmarkmap/} `cat $bookmark`" |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
10 done |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
11 } |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
12 |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
13 setupcommon() { |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
14 cat >> $HGRCPATH << EOF |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
15 [extensions] |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
16 infinitepush= |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
17 [ui] |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
18 ssh = python "$TESTDIR/dummyssh" |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
19 [infinitepush] |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
20 branchpattern=re:scratch/.* |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
21 EOF |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
22 } |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
23 |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
24 setupserver() { |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
25 cat >> .hg/hgrc << EOF |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
26 [infinitepush] |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
27 server=yes |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
28 indextype=disk |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
29 storetype=disk |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
30 reponame=babar |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
31 EOF |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
32 } |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
33 |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
34 waitbgbackup() { |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
35 sleep 1 |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
36 hg debugwaitbackup |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
37 } |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
38 |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
39 mkcommitautobackup() { |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
40 echo $1 > $1 |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
41 hg add $1 |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
42 hg ci -m $1 --config infinitepushbackup.autobackup=True |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
43 } |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
44 |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
45 setuplogdir() { |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
46 mkdir $TESTTMP/logs |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
47 chmod 0755 $TESTTMP/logs |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
48 chmod +t $TESTTMP/logs |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
49 } |