annotate tests/test-init.t @ 23702:c48924787eaa

filectx.parents: enforce changeid of parent to be in own changectx ancestors Because of the way filenodes are computed, you can have multiple changesets "introducing" the same file revision. For example, in the changeset graph below, changeset 2 and 3 both change a file -to- and -from- the same content. o 3: content = new | | o 2: content = new |/ o 1: content = old In such cases, the file revision is create once, when 2 is added, and just reused for 3. So the file change in '3' (from "old" to "new)" has no linkrev pointing to it). We'll call this situation "linkrev-shadowing". As the linkrev is used for optimization purposes when walking a file history, the linkrev-shadowing results in an unexpected jump to another branch during such a walk.. This leads to multiple bugs with log, annotate and rename detection. One element to fix such bugs is to ensure that walking the file history sticks on the same topology as the changeset's history. For this purpose, we extend the logic in 'basefilectx.parents' so that it always defines the proper changeset to associate the parent file revision with. This "proper" changeset has to be an ancestor of the changeset associated with the child file revision. This logic is performed in the '_adjustlinkrev' function. This function is given the starting changeset and all the information regarding the parent file revision. If the linkrev for the file revision is an ancestor of the starting changeset, the linkrev is valid and will be used. If it is not, we detected a topological jump caused by linkrev shadowing, we are going to walk the ancestors of the starting changeset until we find one setting the file to the revision we are trying to create. The performance impact appears acceptable: - We are walking the changelog once for each filelog traversal (as there should be no overlap between searches), - changelog traversal itself is fairly cheap, compared to what is likely going to be perform on the result on the filelog traversal, - We only touch the manifest for ancestors touching the file, And such changesets are likely to be the one introducing the file. (except in pathological cases involving merge), - We use manifest diff instead of full manifest unpacking to check manifest content, so it does not involve applying multiple diffs in most case. - linkrev shadowing is not the common case. Tests for fixed issues in log, annotate and rename detection have been added. But this changeset does not solve all problems. It fixes -ancestry- computation, but if the linkrev-shadowed changesets is the starting one, we'll still get things wrong. We'll have to fix the bootstrapping of such operations in a later changeset. Also, the usage of `hg log FILE` without --follow still has issues with linkrev pointing to hidden changesets, because it relies on the `filelog` revset which implement its own traversal logic that is still to be fixed. Thanks goes to: - Matt Mackall: for nudging me in the right direction - Julien Cristau and RĂ©mi Cardona: for keep telling me linkrev bug were an evolution show stopper for 3 years. - Durham Goode: for finding a new linkrev issue every few weeks - Mads Kiilerich: for that last rename bug who raise this topic over my anoyance limit.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Tue, 23 Dec 2014 15:30:38 -0800
parents 5b6cd8526d56
children e4e69cebeedd
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
22647
5b6cd8526d56 clone: explicitly push bookmarks when cloning from local to remote
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20180
diff changeset
223 exporting bookmark test
13604
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 12712
diff changeset
224 $ hg -R remote-bookmarks bookmarks
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 12712
diff changeset
225 test 0:08b9e9f63b32