Mercurial > hg
annotate tests/test-subrepo @ 10468:2250fc372d34 stable
Fix test-share and test-subrepo under Windows
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Sun, 14 Feb 2010 18:19:18 +0100 |
parents | e433002acb05 |
children | b07d487009b2 |
rev | line source |
---|---|
8816 | 1 #!/bin/sh |
2 | |
3 rm -rf sub | |
4 mkdir sub | |
5 cd sub | |
6 hg init t | |
7 cd t | |
8 | |
9 echo % first revision, no sub | |
10 echo a > a | |
11 hg ci -Am0 | |
12 | |
13 echo % add first sub | |
14 echo s = s > .hgsub | |
15 hg add .hgsub | |
16 hg init s | |
17 echo a > s/a | |
18 hg -R s ci -Ams0 | |
19 hg ci -m1 | |
20 | |
21 echo % add sub sub | |
22 echo ss = ss > s/.hgsub | |
23 hg init s/ss | |
24 echo a > s/ss/a | |
25 hg -R s add s/.hgsub | |
26 hg -R s/ss add s/ss/a | |
27 hg ci -m2 | |
28 | |
29 echo % bump sub rev | |
30 echo b > s/a | |
31 hg -R s ci -ms1 | |
32 hg ci -m3 | |
33 | |
34 echo % leave sub dirty | |
35 echo c > s/a | |
36 hg ci -m4 | |
37 hg tip -R s | |
38 | |
39 echo % check caching | |
40 hg co 0 | |
41 hg debugsub | |
42 echo % restore | |
43 hg co | |
44 hg debugsub | |
45 | |
46 echo % new branch for merge tests | |
47 hg co 1 | |
48 echo t = t >> .hgsub | |
49 hg init t | |
50 echo t > t/t | |
51 hg -R t add t | |
52 echo % 5 | |
53 hg ci -m5 # add sub | |
54 echo t2 > t/t | |
55 echo % 6 | |
56 hg st -R s | |
57 hg ci -m6 # change sub | |
58 hg debugsub | |
59 echo t3 > t/t | |
60 echo % 7 | |
61 hg ci -m7 # change sub again for conflict test | |
62 hg rm .hgsub | |
63 echo % 8 | |
64 hg ci -m8 # remove sub | |
65 | |
66 echo % merge tests | |
67 hg co -C 3 | |
68 hg merge 5 # test adding | |
69 hg debugsub | |
70 hg ci -m9 | |
71 hg merge 6 --debug # test change | |
72 hg debugsub | |
73 echo conflict > t/t | |
74 hg ci -m10 | |
75 HGMERGE=internal:merge hg merge --debug 7 # test conflict | |
76 echo % should conflict | |
77 cat t/t | |
78 | |
79 echo % clone | |
80 cd .. | |
81 hg clone t tc | |
82 cd tc | |
83 hg debugsub | |
84 | |
85 echo % push | |
86 echo bah > t/t | |
87 hg ci -m11 | |
88 hg push | sed 's/ .*sub/ ...sub/g' | |
89 | |
90 echo % push -f | |
91 echo bah > s/a | |
92 hg ci -m12 | |
93 hg push | sed 's/ .*sub/ ...sub/g' | |
94 hg push -f | sed 's/ .*sub/ ...sub/g' | |
95 | |
96 echo % update | |
97 cd ../t | |
98 hg up -C # discard our earlier merge | |
99 echo blah > t/t | |
100 hg ci -m13 | |
101 | |
102 echo % pull | |
103 cd ../tc | |
104 hg pull | sed 's/ .*sub/ ...sub/g' | |
105 hg up # should pull t | |
106 cat t/t | |
10251
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
107 |
10177
5ca0d220ae21
subrepo: add table-based dispatch for subrepo types
Augie Fackler <durin42@gmail.com>
parents:
8816
diff
changeset
|
108 echo % bogus subrepo path aborts |
5ca0d220ae21
subrepo: add table-based dispatch for subrepo types
Augie Fackler <durin42@gmail.com>
parents:
8816
diff
changeset
|
109 echo 'bogus=[boguspath' >> .hgsub |
5ca0d220ae21
subrepo: add table-based dispatch for subrepo types
Augie Fackler <durin42@gmail.com>
parents:
8816
diff
changeset
|
110 hg ci -m 'bogus subrepo path' |
5ca0d220ae21
subrepo: add table-based dispatch for subrepo types
Augie Fackler <durin42@gmail.com>
parents:
8816
diff
changeset
|
111 |
10251
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
112 echo % issue 1986 |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
113 cd .. |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
114 rm -rf sub |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
115 hg init main |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
116 cd main |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
117 |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
118 hg init s # subrepo layout |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
119 cd s # |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
120 echo a > a # o 5 br |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
121 hg ci -Am1 # /| |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
122 hg branch br # o | 4 default |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
123 echo a >> a # | | |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
124 hg ci -m1 # | o 3 br |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
125 hg up default # |/| |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
126 echo b > b # o | 2 default |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
127 hg ci -Am1 # | | |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
128 hg up br # | o 1 br |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
129 hg merge tip # |/ |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
130 hg ci -m1 # o 0 default |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
131 hg up 2 |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
132 echo c > c |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
133 hg ci -Am1 |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
134 hg up 3 |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
135 hg merge 4 |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
136 hg ci -m1 |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
137 |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
138 cd .. # main repo layout: |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
139 echo 's = s' > .hgsub # |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
140 hg -R s up 2 # * <-- try to merge default into br again |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
141 hg ci -Am1 # .`| |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
142 hg branch br # . o 5 br --> substate = 5 |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
143 echo b > b # . | |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
144 hg -R s up 3 # o | 4 default --> substate = 4 |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
145 hg ci -Am1 # | | |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
146 hg up default # | o 3 br --> substate = 2 |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
147 echo c > c # |/| |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
148 hg ci -Am1 # o | 2 default --> substate = 2 |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
149 hg up 1 # | | |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
150 hg merge 2 # | o 1 br --> substate = 3 |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
151 hg ci -m1 # |/ |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
152 hg up 2 # o 0 default --> substate = 2 |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
153 hg -R s up 4 |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
154 echo d > d |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
155 hg ci -Am1 |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
156 hg up 3 |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
157 hg -R s up 5 |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
158 echo e > e |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
159 hg ci -Am1 |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
160 |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
161 hg up 5 |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
162 hg merge 4 # try to merge default into br again |
10378
e1401c74572f
subrepo: change default path in hgrc of subrepo after cloning
Saint Germain <saintger@gmail.com>
parents:
10252
diff
changeset
|
163 cd .. |
e1401c74572f
subrepo: change default path in hgrc of subrepo after cloning
Saint Germain <saintger@gmail.com>
parents:
10252
diff
changeset
|
164 |
e1401c74572f
subrepo: change default path in hgrc of subrepo after cloning
Saint Germain <saintger@gmail.com>
parents:
10252
diff
changeset
|
165 echo % test repository cloning |
e1401c74572f
subrepo: change default path in hgrc of subrepo after cloning
Saint Germain <saintger@gmail.com>
parents:
10252
diff
changeset
|
166 mkdir mercurial mercurial2 |
e1401c74572f
subrepo: change default path in hgrc of subrepo after cloning
Saint Germain <saintger@gmail.com>
parents:
10252
diff
changeset
|
167 hg init nested_absolute |
e1401c74572f
subrepo: change default path in hgrc of subrepo after cloning
Saint Germain <saintger@gmail.com>
parents:
10252
diff
changeset
|
168 echo test > nested_absolute/foo |
e1401c74572f
subrepo: change default path in hgrc of subrepo after cloning
Saint Germain <saintger@gmail.com>
parents:
10252
diff
changeset
|
169 hg -R nested_absolute add |
e1401c74572f
subrepo: change default path in hgrc of subrepo after cloning
Saint Germain <saintger@gmail.com>
parents:
10252
diff
changeset
|
170 hg -R nested_absolute ci -mtest |
e1401c74572f
subrepo: change default path in hgrc of subrepo after cloning
Saint Germain <saintger@gmail.com>
parents:
10252
diff
changeset
|
171 cd mercurial |
e1401c74572f
subrepo: change default path in hgrc of subrepo after cloning
Saint Germain <saintger@gmail.com>
parents:
10252
diff
changeset
|
172 hg init nested_relative |
e1401c74572f
subrepo: change default path in hgrc of subrepo after cloning
Saint Germain <saintger@gmail.com>
parents:
10252
diff
changeset
|
173 echo test2 > nested_relative/foo2 |
e1401c74572f
subrepo: change default path in hgrc of subrepo after cloning
Saint Germain <saintger@gmail.com>
parents:
10252
diff
changeset
|
174 hg -R nested_relative add |
e1401c74572f
subrepo: change default path in hgrc of subrepo after cloning
Saint Germain <saintger@gmail.com>
parents:
10252
diff
changeset
|
175 hg -R nested_relative ci -mtest2 |
e1401c74572f
subrepo: change default path in hgrc of subrepo after cloning
Saint Germain <saintger@gmail.com>
parents:
10252
diff
changeset
|
176 hg init main |
e1401c74572f
subrepo: change default path in hgrc of subrepo after cloning
Saint Germain <saintger@gmail.com>
parents:
10252
diff
changeset
|
177 echo nested_relative = ../nested_relative > main/.hgsub |
10413
e433002acb05
fix up a bunch of check-code warnings
Matt Mackall <mpm@selenic.com>
parents:
10378
diff
changeset
|
178 echo nested_absolute = `pwd`/nested_absolute >> main/.hgsub |
10378
e1401c74572f
subrepo: change default path in hgrc of subrepo after cloning
Saint Germain <saintger@gmail.com>
parents:
10252
diff
changeset
|
179 hg -R main add |
e1401c74572f
subrepo: change default path in hgrc of subrepo after cloning
Saint Germain <saintger@gmail.com>
parents:
10252
diff
changeset
|
180 hg -R main ci -m "add subrepos" |
e1401c74572f
subrepo: change default path in hgrc of subrepo after cloning
Saint Germain <saintger@gmail.com>
parents:
10252
diff
changeset
|
181 cd .. |
e1401c74572f
subrepo: change default path in hgrc of subrepo after cloning
Saint Germain <saintger@gmail.com>
parents:
10252
diff
changeset
|
182 hg clone mercurial/main mercurial2/main |
10468
2250fc372d34
Fix test-share and test-subrepo under Windows
Patrick Mezard <pmezard@gmail.com>
parents:
10413
diff
changeset
|
183 cat mercurial2/main/nested_absolute/.hg/hgrc \ |
2250fc372d34
Fix test-share and test-subrepo under Windows
Patrick Mezard <pmezard@gmail.com>
parents:
10413
diff
changeset
|
184 mercurial2/main/nested_relative/.hg/hgrc \ |
2250fc372d34
Fix test-share and test-subrepo under Windows
Patrick Mezard <pmezard@gmail.com>
parents:
10413
diff
changeset
|
185 | "$TESTDIR/filtertmp.py" |
10378
e1401c74572f
subrepo: change default path in hgrc of subrepo after cloning
Saint Germain <saintger@gmail.com>
parents:
10252
diff
changeset
|
186 rm -rf mercurial mercurial2 |
10251
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
187 |
a19d2993385d
subrepo: fix merging of already merged subrepos (issue1986)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8816
diff
changeset
|
188 exit 0 |