annotate tests/test-init.t @ 20182:04036798ebed

branches: avoid unnecessary changectx.branch() calls This requires reading from the changelog, which can be costly over NFS. Note that this does not totally remove reading from the changelog; we still do that when calling changectx.closesbranch(). That call will be removed in a later patch. Running hg branches on the PyPy repo (with 996) over a busy NFS server, before this change: $ time hg --profile branches > /dev/null CallCount Recursive Total(s) Inline(s) module:lineno(function) 2042 0 2.2827 2.2827 <open> 2036 0 0.9840 0.9840 <method 'close' of 'file' objects> 2036 0 0.0464 0.0464 <method 'read' of 'file' objects> 5233 0 0.1985 0.0453 mercurial.repoview:161(changelog) 10462 0 0.0791 0.0314 mercurial.changelog:133(tip) 5233 0 0.0388 0.0176 mercurial.localrepo:26(__get__) 10462 0 0.0250 0.0126 <len> 5233 0 0.0059 0.0039 mercurial.repoview:112(filterrevs) 10462 0 0.0029 0.0029 <hash> 2034 0 0.0444 0.0444 <method 'seek' of 'file' objects> 5340 0 0.0390 0.0390 mercurial.revlog:296(rev) 2582 0 0.0371 0.0371 <zlib.decompress> 3155 0 0.1963 0.0366 mercurial.context:202(__init__) 3155 0 0.1238 0.0306 mercurial.repoview:161(changelog) 3155 0 0.0261 0.0080 mercurial.changelog:183(rev) 9465 0 0.0061 0.0061 <isinstance> 1096 0 0.0023 0.0023 <binascii.unhexlify> 4251 0 0.0014 0.0014 <len> 2059 0 3.7341 0.0332 mercurial.changelog:270(read) 2059 0 3.6304 0.0307 mercurial.revlog:907(revision) 2057 0 0.0262 0.0137 mercurial.changelog:28(decodeextra) 4118 0 0.0094 0.0094 <method 'split' of 'str' objects> 4118 0 0.0270 0.0048 mercurial.encoding:61(tolocal) 2059 0 0.0040 0.0040 <method 'index' of 'str' objects> 10462 0 0.0791 0.0314 mercurial.changelog:133(tip) 10462 0 0.0289 0.0207 mercurial.changelog:190(node) 10462 0 0.0188 0.0091 <len> 52433 20932 0.0478 0.0310 <len> 20932 0 0.0221 0.0168 mercurial.revlog:262(__len__) 2059 0 3.6304 0.0307 mercurial.revlog:907(revision) real 0m4.361s user 0m0.986s sys 0m0.237s After this change: $ time hg --profile branches > /dev/null CallCount Recursive Total(s) Inline(s) module:lineno(function) 1069 0 1.1098 1.1098 <open> 1063 0 0.4865 0.4865 <method 'close' of 'file' objects> 4122 0 0.1811 0.0404 mercurial.repoview:161(changelog) 8240 0 0.0712 0.0272 mercurial.changelog:133(tip) 4122 0 0.0378 0.0177 mercurial.localrepo:26(__get__) 8240 0 0.0221 0.0115 <len> 4122 0 0.0057 0.0033 mercurial.repoview:112(filterrevs) 8240 0 0.0025 0.0025 <hash> 3029 0 0.1979 0.0371 mercurial.context:202(__init__) 3029 0 0.1278 0.0310 mercurial.repoview:161(changelog) 3029 0 0.0230 0.0081 mercurial.changelog:183(rev) 9087 0 0.0061 0.0061 <isinstance> 1096 0 0.0026 0.0026 <binascii.unhexlify> 4125 0 0.0014 0.0014 <len> 4229 0 0.0337 0.0337 mercurial.revlog:296(rev) 1061 0 0.0296 0.0296 <method 'seek' of 'file' objects> 1063 0 0.0292 0.0292 <method 'read' of 'file' objects> 8240 0 0.0712 0.0272 mercurial.changelog:133(tip) 8240 0 0.0271 0.0196 mercurial.changelog:190(node) 8240 0 0.0169 0.0083 <len> 40476 16488 0.0422 0.0271 <len> 16488 0 0.0193 0.0152 mercurial.revlog:262(__len__) 1342 0 0.0241 0.0241 <zlib.decompress> 9445 0 0.0336 0.0224 mercurial.changelog:190(node) 9445 0 0.0112 0.0112 mercurial.revlog:317(node) 1074 0 1.9102 0.0224 mercurial.changelog:270(read) 1074 0 1.8397 0.0202 mercurial.revlog:907(revision) 1073 0 0.0187 0.0099 mercurial.changelog:28(decodeextra) 2148 0 0.0061 0.0061 <method 'split' of 'str' objects> 2148 0 0.0184 0.0034 mercurial.encoding:61(tolocal) real 0m2.402s user 0m0.735s sys 0m0.177s
author Brodie Rao <brodie@sf.io>
date Fri, 15 Nov 2013 23:18:08 -0500
parents 969148b49fc6
children 5b6cd8526d56
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12328
b63f6422d2a7 tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12316
diff changeset
1 This test tries to exercise the ssh functionality with a dummy script
2599
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
2
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
3 $ checknewrepo()
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
4 > {
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
5 > name=$1
12584
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
6 > if [ -d "$name"/.hg/store ]; then
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
7 > echo store created
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
8 > fi
12584
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
9 > if [ -f "$name"/.hg/00changelog.i ]; then
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
10 > echo 00changelog.i created
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
11 > fi
12584
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
12 > cat "$name"/.hg/requires
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
13 > }
2599
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
14
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
15 creating 'local'
4166
c0271aba6abe small fixes for the parent patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3713
diff changeset
16
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
17 $ hg init local
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
18 $ checknewrepo local
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
19 store created
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
20 00changelog.i created
18356
752f77ef7202 localrepo: store requirements sorted
Mads Kiilerich <mads@kiilerich.com>
parents: 16974
diff changeset
21 dotencode
14905
207935cda6dc localrepo: make requirements attribute of newly-created repos contain a set
Andrew Pritchard <andrewp@fogcreek.com>
parents: 14186
diff changeset
22 fncache
18356
752f77ef7202 localrepo: store requirements sorted
Mads Kiilerich <mads@kiilerich.com>
parents: 16974
diff changeset
23 revlogv1
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
24 store
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
25 $ echo this > local/foo
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11883
diff changeset
26 $ hg ci --cwd local -A -m "init"
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
27 adding foo
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
28
20180
969148b49fc6 revlog: allow tuning of the chunk cache size (via format.chunkcachesize)
Brodie Rao <brodie@sf.io>
parents: 18356
diff changeset
29 test custom revlog chunk cache sizes
969148b49fc6 revlog: allow tuning of the chunk cache size (via format.chunkcachesize)
Brodie Rao <brodie@sf.io>
parents: 18356
diff changeset
30
969148b49fc6 revlog: allow tuning of the chunk cache size (via format.chunkcachesize)
Brodie Rao <brodie@sf.io>
parents: 18356
diff changeset
31 $ hg --config format.chunkcachesize=0 log -R local -pv
969148b49fc6 revlog: allow tuning of the chunk cache size (via format.chunkcachesize)
Brodie Rao <brodie@sf.io>
parents: 18356
diff changeset
32 abort: revlog chunk cache size 0 is not greater than 0!
969148b49fc6 revlog: allow tuning of the chunk cache size (via format.chunkcachesize)
Brodie Rao <brodie@sf.io>
parents: 18356
diff changeset
33 [255]
969148b49fc6 revlog: allow tuning of the chunk cache size (via format.chunkcachesize)
Brodie Rao <brodie@sf.io>
parents: 18356
diff changeset
34 $ hg --config format.chunkcachesize=1023 log -R local -pv
969148b49fc6 revlog: allow tuning of the chunk cache size (via format.chunkcachesize)
Brodie Rao <brodie@sf.io>
parents: 18356
diff changeset
35 abort: revlog chunk cache size 1023 is not a power of 2!
969148b49fc6 revlog: allow tuning of the chunk cache size (via format.chunkcachesize)
Brodie Rao <brodie@sf.io>
parents: 18356
diff changeset
36 [255]
969148b49fc6 revlog: allow tuning of the chunk cache size (via format.chunkcachesize)
Brodie Rao <brodie@sf.io>
parents: 18356
diff changeset
37 $ hg --config format.chunkcachesize=1024 log -R local -pv
969148b49fc6 revlog: allow tuning of the chunk cache size (via format.chunkcachesize)
Brodie Rao <brodie@sf.io>
parents: 18356
diff changeset
38 changeset: 0:08b9e9f63b32
969148b49fc6 revlog: allow tuning of the chunk cache size (via format.chunkcachesize)
Brodie Rao <brodie@sf.io>
parents: 18356
diff changeset
39 tag: tip
969148b49fc6 revlog: allow tuning of the chunk cache size (via format.chunkcachesize)
Brodie Rao <brodie@sf.io>
parents: 18356
diff changeset
40 user: test
969148b49fc6 revlog: allow tuning of the chunk cache size (via format.chunkcachesize)
Brodie Rao <brodie@sf.io>
parents: 18356
diff changeset
41 date: Thu Jan 01 00:00:00 1970 +0000
969148b49fc6 revlog: allow tuning of the chunk cache size (via format.chunkcachesize)
Brodie Rao <brodie@sf.io>
parents: 18356
diff changeset
42 files: foo
969148b49fc6 revlog: allow tuning of the chunk cache size (via format.chunkcachesize)
Brodie Rao <brodie@sf.io>
parents: 18356
diff changeset
43 description:
969148b49fc6 revlog: allow tuning of the chunk cache size (via format.chunkcachesize)
Brodie Rao <brodie@sf.io>
parents: 18356
diff changeset
44 init
969148b49fc6 revlog: allow tuning of the chunk cache size (via format.chunkcachesize)
Brodie Rao <brodie@sf.io>
parents: 18356
diff changeset
45
969148b49fc6 revlog: allow tuning of the chunk cache size (via format.chunkcachesize)
Brodie Rao <brodie@sf.io>
parents: 18356
diff changeset
46
969148b49fc6 revlog: allow tuning of the chunk cache size (via format.chunkcachesize)
Brodie Rao <brodie@sf.io>
parents: 18356
diff changeset
47 diff -r 000000000000 -r 08b9e9f63b32 foo
969148b49fc6 revlog: allow tuning of the chunk cache size (via format.chunkcachesize)
Brodie Rao <brodie@sf.io>
parents: 18356
diff changeset
48 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
969148b49fc6 revlog: allow tuning of the chunk cache size (via format.chunkcachesize)
Brodie Rao <brodie@sf.io>
parents: 18356
diff changeset
49 +++ b/foo Thu Jan 01 00:00:00 1970 +0000
969148b49fc6 revlog: allow tuning of the chunk cache size (via format.chunkcachesize)
Brodie Rao <brodie@sf.io>
parents: 18356
diff changeset
50 @@ -0,0 +1,1 @@
969148b49fc6 revlog: allow tuning of the chunk cache size (via format.chunkcachesize)
Brodie Rao <brodie@sf.io>
parents: 18356
diff changeset
51 +this
969148b49fc6 revlog: allow tuning of the chunk cache size (via format.chunkcachesize)
Brodie Rao <brodie@sf.io>
parents: 18356
diff changeset
52
969148b49fc6 revlog: allow tuning of the chunk cache size (via format.chunkcachesize)
Brodie Rao <brodie@sf.io>
parents: 18356
diff changeset
53
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
54 creating repo with format.usestore=false
4166
c0271aba6abe small fixes for the parent patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3713
diff changeset
55
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
56 $ hg --config format.usestore=false init old
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
57 $ checknewrepo old
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
58 revlogv1
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
59
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
60 creating repo with format.usefncache=false
4166
c0271aba6abe small fixes for the parent patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3713
diff changeset
61
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
62 $ hg --config format.usefncache=false init old2
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
63 $ checknewrepo old2
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
64 store created
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
65 00changelog.i created
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
66 revlogv1
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
67 store
4166
c0271aba6abe small fixes for the parent patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3713
diff changeset
68
12712
1b546140b85e tests: add testcase for --config format.dotencode=false
Adrian Buehlmann <adrian@cadifra.com>
parents: 12687
diff changeset
69 creating repo with format.dotencode=false
1b546140b85e tests: add testcase for --config format.dotencode=false
Adrian Buehlmann <adrian@cadifra.com>
parents: 12687
diff changeset
70
1b546140b85e tests: add testcase for --config format.dotencode=false
Adrian Buehlmann <adrian@cadifra.com>
parents: 12687
diff changeset
71 $ hg --config format.dotencode=false init old3
1b546140b85e tests: add testcase for --config format.dotencode=false
Adrian Buehlmann <adrian@cadifra.com>
parents: 12687
diff changeset
72 $ checknewrepo old3
1b546140b85e tests: add testcase for --config format.dotencode=false
Adrian Buehlmann <adrian@cadifra.com>
parents: 12687
diff changeset
73 store created
1b546140b85e tests: add testcase for --config format.dotencode=false
Adrian Buehlmann <adrian@cadifra.com>
parents: 12687
diff changeset
74 00changelog.i created
18356
752f77ef7202 localrepo: store requirements sorted
Mads Kiilerich <mads@kiilerich.com>
parents: 16974
diff changeset
75 fncache
12712
1b546140b85e tests: add testcase for --config format.dotencode=false
Adrian Buehlmann <adrian@cadifra.com>
parents: 12687
diff changeset
76 revlogv1
1b546140b85e tests: add testcase for --config format.dotencode=false
Adrian Buehlmann <adrian@cadifra.com>
parents: 12687
diff changeset
77 store
1b546140b85e tests: add testcase for --config format.dotencode=false
Adrian Buehlmann <adrian@cadifra.com>
parents: 12687
diff changeset
78
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
79 test failure
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
80
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
81 $ hg init local
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
82 abort: repository local already exists!
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
83 [255]
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
84
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
85 init+push to remote2
2599
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
86
16541
bb3334806ace tests: quote dummyssh in a way that works on windows too
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
87 $ hg init -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote2
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
88 $ hg incoming -R remote2 local
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
89 comparing with local
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11883
diff changeset
90 changeset: 0:08b9e9f63b32
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
91 tag: tip
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
92 user: test
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11883
diff changeset
93 date: Thu Jan 01 00:00:00 1970 +0000
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
94 summary: init
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
95
4166
c0271aba6abe small fixes for the parent patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3713
diff changeset
96
16541
bb3334806ace tests: quote dummyssh in a way that works on windows too
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
97 $ hg push -R local -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote2
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
98 pushing to ssh://user@dummy/remote2
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
99 searching for changes
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
100 remote: adding changesets
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
101 remote: adding manifests
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
102 remote: adding file changes
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
103 remote: added 1 changesets with 1 changes to 1 files
7249
671b3e1eac2e test-init: add test with format.usefncache=false
Adrian Buehlmann <adrian@cadifra.com>
parents: 4297
diff changeset
104
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
105 clone to remote1
3037
3acb76f0124d clone: simplifying dest repo creation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 2599
diff changeset
106
16541
bb3334806ace tests: quote dummyssh in a way that works on windows too
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
107 $ hg clone -e "python \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote1
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
108 searching for changes
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
109 remote: adding changesets
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
110 remote: adding manifests
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
111 remote: adding file changes
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
112 remote: added 1 changesets with 1 changes to 1 files
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
113
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
114 init to existing repo
2599
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
115
16541
bb3334806ace tests: quote dummyssh in a way that works on windows too
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
116 $ hg init -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote1
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
117 abort: repository remote1 already exists!
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
118 abort: could not create remote repo!
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
119 [255]
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
120
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
121 clone to existing repo
2599
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
122
16541
bb3334806ace tests: quote dummyssh in a way that works on windows too
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
123 $ hg clone -e "python \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote1
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
124 abort: repository remote1 already exists!
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
125 abort: could not create remote repo!
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
126 [255]
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
127
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
128 output of dummyssh
3037
3acb76f0124d clone: simplifying dest repo creation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 2599
diff changeset
129
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
130 $ cat dummylog
15622
86fc364ca5f8 sshrepo: don't quote obviously safe strings (issue2983)
Mads Kiilerich <mads@kiilerich.com>
parents: 15581
diff changeset
131 Got arguments 1:user@dummy 2:hg init remote2
86fc364ca5f8 sshrepo: don't quote obviously safe strings (issue2983)
Mads Kiilerich <mads@kiilerich.com>
parents: 15581
diff changeset
132 Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio
86fc364ca5f8 sshrepo: don't quote obviously safe strings (issue2983)
Mads Kiilerich <mads@kiilerich.com>
parents: 15581
diff changeset
133 Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio
86fc364ca5f8 sshrepo: don't quote obviously safe strings (issue2983)
Mads Kiilerich <mads@kiilerich.com>
parents: 15581
diff changeset
134 Got arguments 1:user@dummy 2:hg init remote1
86fc364ca5f8 sshrepo: don't quote obviously safe strings (issue2983)
Mads Kiilerich <mads@kiilerich.com>
parents: 15581
diff changeset
135 Got arguments 1:user@dummy 2:hg -R remote1 serve --stdio
86fc364ca5f8 sshrepo: don't quote obviously safe strings (issue2983)
Mads Kiilerich <mads@kiilerich.com>
parents: 15581
diff changeset
136 Got arguments 1:user@dummy 2:hg init remote1
86fc364ca5f8 sshrepo: don't quote obviously safe strings (issue2983)
Mads Kiilerich <mads@kiilerich.com>
parents: 15581
diff changeset
137 Got arguments 1:user@dummy 2:hg init remote1
3037
3acb76f0124d clone: simplifying dest repo creation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 2599
diff changeset
138
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
139 comparing repositories
2599
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
140
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
141 $ hg tip -q -R local
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11883
diff changeset
142 0:08b9e9f63b32
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
143 $ hg tip -q -R remote1
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11883
diff changeset
144 0:08b9e9f63b32
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
145 $ hg tip -q -R remote2
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11883
diff changeset
146 0:08b9e9f63b32
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
147
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
148 check names for repositories (clashes with URL schemes, special chars)
2599
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
149
16915
ccebe526d321 test-init: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16541
diff changeset
150 $ for i in bundle file hg http https old-http ssh static-http "with space"; do
11883
01e04df696e3 test-init: replace 'echo -n' with 'printf'
Martin Geisler <mg@lazybytes.net>
parents: 11786
diff changeset
151 > printf "hg init \"$i\"... "
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
152 > hg init "$i"
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
153 > test -d "$i" -a -d "$i/.hg" && echo "ok" || echo "failed"
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
154 > done
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
155 hg init "bundle"... ok
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
156 hg init "file"... ok
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
157 hg init "hg"... ok
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
158 hg init "http"... ok
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
159 hg init "https"... ok
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
160 hg init "old-http"... ok
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
161 hg init "ssh"... ok
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
162 hg init "static-http"... ok
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
163 hg init "with space"... ok
16974
01ed5bb5cd41 tests: use hghave eol-in-paths to test for support for ':' in filenames and " "
Mads Kiilerich <mads@kiilerich.com>
parents: 16915
diff changeset
164 #if eol-in-paths
16915
ccebe526d321 test-init: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16541
diff changeset
165 /* " " is not a valid name for a directory on Windows */
ccebe526d321 test-init: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16541
diff changeset
166 $ hg init " "
ccebe526d321 test-init: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16541
diff changeset
167 $ test -d " "
ccebe526d321 test-init: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16541
diff changeset
168 $ test -d " /.hg"
ccebe526d321 test-init: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16541
diff changeset
169 #endif
2599
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
170
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
171 creating 'local/sub/repo'
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
172
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
173 $ hg init local/sub/repo
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
174 $ checknewrepo local/sub/repo
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
175 store created
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
176 00changelog.i created
18356
752f77ef7202 localrepo: store requirements sorted
Mads Kiilerich <mads@kiilerich.com>
parents: 16974
diff changeset
177 dotencode
14905
207935cda6dc localrepo: make requirements attribute of newly-created repos contain a set
Andrew Pritchard <andrewp@fogcreek.com>
parents: 14186
diff changeset
178 fncache
18356
752f77ef7202 localrepo: store requirements sorted
Mads Kiilerich <mads@kiilerich.com>
parents: 16974
diff changeset
179 revlogv1
11786
38e3f973a4f3 tests: unify test-init
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11640
diff changeset
180 store
12584
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
181
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
182 prepare test of init of url configured from paths
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
183
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
184 $ echo '[paths]' >> $HGRCPATH
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
185 $ echo "somewhere = `pwd`/url from paths" >> $HGRCPATH
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
186 $ echo "elsewhere = `pwd`/another paths url" >> $HGRCPATH
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
187
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
188 init should (for consistency with clone) expand the url
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
189
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
190 $ hg init somewhere
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
191 $ checknewrepo "url from paths"
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
192 store created
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
193 00changelog.i created
18356
752f77ef7202 localrepo: store requirements sorted
Mads Kiilerich <mads@kiilerich.com>
parents: 16974
diff changeset
194 dotencode
14905
207935cda6dc localrepo: make requirements attribute of newly-created repos contain a set
Andrew Pritchard <andrewp@fogcreek.com>
parents: 14186
diff changeset
195 fncache
18356
752f77ef7202 localrepo: store requirements sorted
Mads Kiilerich <mads@kiilerich.com>
parents: 16974
diff changeset
196 revlogv1
12584
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
197 store
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
198
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
199 verify that clone also expand urls
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
200
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
201 $ hg clone somewhere elsewhere
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
202 updating to branch default
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
203 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
204 $ checknewrepo "another paths url"
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
205 store created
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
206 00changelog.i created
18356
752f77ef7202 localrepo: store requirements sorted
Mads Kiilerich <mads@kiilerich.com>
parents: 16974
diff changeset
207 dotencode
14905
207935cda6dc localrepo: make requirements attribute of newly-created repos contain a set
Andrew Pritchard <andrewp@fogcreek.com>
parents: 14186
diff changeset
208 fncache
18356
752f77ef7202 localrepo: store requirements sorted
Mads Kiilerich <mads@kiilerich.com>
parents: 16974
diff changeset
209 revlogv1
12584
fb24b491e06a init: expand destination url as a configured paths
Mads Kiilerich <mads@kiilerich.com>
parents: 12328
diff changeset
210 store
13604
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 12712
diff changeset
211
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 12712
diff changeset
212 clone bookmarks
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 12712
diff changeset
213
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 12712
diff changeset
214 $ hg -R local bookmark test
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 12712
diff changeset
215 $ hg -R local bookmarks
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 12712
diff changeset
216 * test 0:08b9e9f63b32
16541
bb3334806ace tests: quote dummyssh in a way that works on windows too
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
217 $ hg clone -e "python \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote-bookmarks
13604
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 12712
diff changeset
218 searching for changes
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 12712
diff changeset
219 remote: adding changesets
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 12712
diff changeset
220 remote: adding manifests
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 12712
diff changeset
221 remote: adding file changes
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 12712
diff changeset
222 remote: added 1 changesets with 1 changes to 1 files
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 12712
diff changeset
223 $ hg -R remote-bookmarks bookmarks
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 12712
diff changeset
224 test 0:08b9e9f63b32