##// END OF EJS Templates
tests: properly position conditional output on Windows in test-subrepo.t...
Matt Harbison -
r42808:8486675a default draft
parent child Browse files
Show More
@@ -1,2023 +1,2023 b''
1 Let commit recurse into subrepos by default to match pre-2.0 behavior:
1 Let commit recurse into subrepos by default to match pre-2.0 behavior:
2
2
3 $ echo "[ui]" >> $HGRCPATH
3 $ echo "[ui]" >> $HGRCPATH
4 $ echo "commitsubrepos = Yes" >> $HGRCPATH
4 $ echo "commitsubrepos = Yes" >> $HGRCPATH
5
5
6 $ hg init t
6 $ hg init t
7 $ cd t
7 $ cd t
8
8
9 first revision, no sub
9 first revision, no sub
10
10
11 $ echo a > a
11 $ echo a > a
12 $ hg ci -Am0
12 $ hg ci -Am0
13 adding a
13 adding a
14
14
15 add first sub
15 add first sub
16
16
17 $ echo s = s > .hgsub
17 $ echo s = s > .hgsub
18 $ hg add .hgsub
18 $ hg add .hgsub
19 $ hg init s
19 $ hg init s
20 $ echo a > s/a
20 $ echo a > s/a
21
21
22 Issue2232: committing a subrepo without .hgsub
22 Issue2232: committing a subrepo without .hgsub
23
23
24 $ hg ci -mbad s
24 $ hg ci -mbad s
25 abort: can't commit subrepos without .hgsub
25 abort: can't commit subrepos without .hgsub
26 [255]
26 [255]
27
27
28 $ hg -R s add s/a
28 $ hg -R s add s/a
29 $ hg files -S
29 $ hg files -S
30 .hgsub
30 .hgsub
31 a
31 a
32 s/a
32 s/a
33
33
34 `hg files` respects ui.relative-paths
34 `hg files` respects ui.relative-paths
35 BROKEN: shows subrepo paths relative to the subrepo
35 BROKEN: shows subrepo paths relative to the subrepo
36 $ hg files -S --config ui.relative-paths=no
36 $ hg files -S --config ui.relative-paths=no
37 .hgsub
37 .hgsub
38 a
38 a
39 s/a
39 s/a
40
40
41 $ hg -R s ci -Ams0
41 $ hg -R s ci -Ams0
42 $ hg sum
42 $ hg sum
43 parent: 0:f7b1eb17ad24 tip
43 parent: 0:f7b1eb17ad24 tip
44 0
44 0
45 branch: default
45 branch: default
46 commit: 1 added, 1 subrepos
46 commit: 1 added, 1 subrepos
47 update: (current)
47 update: (current)
48 phases: 1 draft
48 phases: 1 draft
49 $ hg ci -m1
49 $ hg ci -m1
50
50
51 test handling .hgsubstate "added" explicitly.
51 test handling .hgsubstate "added" explicitly.
52
52
53 $ hg parents --template '{node}\n{files}\n'
53 $ hg parents --template '{node}\n{files}\n'
54 7cf8cfea66e410e8e3336508dfeec07b3192de51
54 7cf8cfea66e410e8e3336508dfeec07b3192de51
55 .hgsub .hgsubstate
55 .hgsub .hgsubstate
56 $ hg rollback -q
56 $ hg rollback -q
57 $ hg add .hgsubstate
57 $ hg add .hgsubstate
58 $ hg ci -m1
58 $ hg ci -m1
59 $ hg parents --template '{node}\n{files}\n'
59 $ hg parents --template '{node}\n{files}\n'
60 7cf8cfea66e410e8e3336508dfeec07b3192de51
60 7cf8cfea66e410e8e3336508dfeec07b3192de51
61 .hgsub .hgsubstate
61 .hgsub .hgsubstate
62
62
63 Subrepopath which overlaps with filepath, does not change warnings in remove()
63 Subrepopath which overlaps with filepath, does not change warnings in remove()
64
64
65 $ mkdir snot
65 $ mkdir snot
66 $ touch snot/file
66 $ touch snot/file
67 $ hg remove -S snot/file
67 $ hg remove -S snot/file
68 not removing snot/file: file is untracked
68 not removing snot/file: file is untracked
69 [1]
69 [1]
70 $ hg cat snot/filenot
70 $ hg cat snot/filenot
71 snot/filenot: no such file in rev 7cf8cfea66e4
71 snot/filenot: no such file in rev 7cf8cfea66e4
72 [1]
72 [1]
73 $ rm -r snot
73 $ rm -r snot
74
74
75 Revert subrepo and test subrepo fileset keyword:
75 Revert subrepo and test subrepo fileset keyword:
76
76
77 $ echo b > s/a
77 $ echo b > s/a
78 $ hg revert --dry-run "set:subrepo('glob:s*')"
78 $ hg revert --dry-run "set:subrepo('glob:s*')"
79 reverting subrepo s
79 reverting subrepo s
80 reverting s/a
80 reverting s/a
81 $ cat s/a
81 $ cat s/a
82 b
82 b
83 $ hg revert "set:subrepo('glob:s*')"
83 $ hg revert "set:subrepo('glob:s*')"
84 reverting subrepo s
84 reverting subrepo s
85 reverting s/a
85 reverting s/a
86 $ cat s/a
86 $ cat s/a
87 a
87 a
88 $ rm s/a.orig
88 $ rm s/a.orig
89
89
90 Revert subrepo with no backup. The "reverting s/a" line is gone since
90 Revert subrepo with no backup. The "reverting s/a" line is gone since
91 we're really running 'hg update' in the subrepo:
91 we're really running 'hg update' in the subrepo:
92
92
93 $ echo b > s/a
93 $ echo b > s/a
94 $ hg revert --no-backup s
94 $ hg revert --no-backup s
95 reverting subrepo s
95 reverting subrepo s
96
96
97 Issue2022: update -C
97 Issue2022: update -C
98
98
99 $ echo b > s/a
99 $ echo b > s/a
100 $ hg sum
100 $ hg sum
101 parent: 1:7cf8cfea66e4 tip
101 parent: 1:7cf8cfea66e4 tip
102 1
102 1
103 branch: default
103 branch: default
104 commit: 1 subrepos
104 commit: 1 subrepos
105 update: (current)
105 update: (current)
106 phases: 2 draft
106 phases: 2 draft
107 $ hg co -C 1
107 $ hg co -C 1
108 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
108 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
109 $ hg sum
109 $ hg sum
110 parent: 1:7cf8cfea66e4 tip
110 parent: 1:7cf8cfea66e4 tip
111 1
111 1
112 branch: default
112 branch: default
113 commit: (clean)
113 commit: (clean)
114 update: (current)
114 update: (current)
115 phases: 2 draft
115 phases: 2 draft
116
116
117 commands that require a clean repo should respect subrepos
117 commands that require a clean repo should respect subrepos
118
118
119 $ echo b >> s/a
119 $ echo b >> s/a
120 $ hg backout tip
120 $ hg backout tip
121 abort: uncommitted changes in subrepository "s"
121 abort: uncommitted changes in subrepository "s"
122 [255]
122 [255]
123 $ hg revert -C -R s s/a
123 $ hg revert -C -R s s/a
124
124
125 add sub sub
125 add sub sub
126
126
127 $ echo ss = ss > s/.hgsub
127 $ echo ss = ss > s/.hgsub
128 $ hg init s/ss
128 $ hg init s/ss
129 $ echo a > s/ss/a
129 $ echo a > s/ss/a
130 $ hg -R s add s/.hgsub
130 $ hg -R s add s/.hgsub
131 $ hg -R s/ss add s/ss/a
131 $ hg -R s/ss add s/ss/a
132 $ hg sum
132 $ hg sum
133 parent: 1:7cf8cfea66e4 tip
133 parent: 1:7cf8cfea66e4 tip
134 1
134 1
135 branch: default
135 branch: default
136 commit: 1 subrepos
136 commit: 1 subrepos
137 update: (current)
137 update: (current)
138 phases: 2 draft
138 phases: 2 draft
139 $ hg ci -m2
139 $ hg ci -m2
140 committing subrepository s
140 committing subrepository s
141 committing subrepository s/ss
141 committing subrepository s/ss
142 $ hg sum
142 $ hg sum
143 parent: 2:df30734270ae tip
143 parent: 2:df30734270ae tip
144 2
144 2
145 branch: default
145 branch: default
146 commit: (clean)
146 commit: (clean)
147 update: (current)
147 update: (current)
148 phases: 3 draft
148 phases: 3 draft
149
149
150 test handling .hgsubstate "modified" explicitly.
150 test handling .hgsubstate "modified" explicitly.
151
151
152 $ hg parents --template '{node}\n{files}\n'
152 $ hg parents --template '{node}\n{files}\n'
153 df30734270ae757feb35e643b7018e818e78a9aa
153 df30734270ae757feb35e643b7018e818e78a9aa
154 .hgsubstate
154 .hgsubstate
155 $ hg rollback -q
155 $ hg rollback -q
156 $ hg status -A .hgsubstate
156 $ hg status -A .hgsubstate
157 M .hgsubstate
157 M .hgsubstate
158 $ hg ci -m2
158 $ hg ci -m2
159 $ hg parents --template '{node}\n{files}\n'
159 $ hg parents --template '{node}\n{files}\n'
160 df30734270ae757feb35e643b7018e818e78a9aa
160 df30734270ae757feb35e643b7018e818e78a9aa
161 .hgsubstate
161 .hgsubstate
162
162
163 bump sub rev (and check it is ignored by ui.commitsubrepos)
163 bump sub rev (and check it is ignored by ui.commitsubrepos)
164
164
165 $ echo b > s/a
165 $ echo b > s/a
166 $ hg -R s ci -ms1
166 $ hg -R s ci -ms1
167 $ hg --config ui.commitsubrepos=no ci -m3
167 $ hg --config ui.commitsubrepos=no ci -m3
168
168
169 leave sub dirty (and check ui.commitsubrepos=no aborts the commit)
169 leave sub dirty (and check ui.commitsubrepos=no aborts the commit)
170
170
171 $ echo c > s/a
171 $ echo c > s/a
172 $ hg --config ui.commitsubrepos=no ci -m4
172 $ hg --config ui.commitsubrepos=no ci -m4
173 abort: uncommitted changes in subrepository "s"
173 abort: uncommitted changes in subrepository "s"
174 (use --subrepos for recursive commit)
174 (use --subrepos for recursive commit)
175 [255]
175 [255]
176 $ hg id
176 $ hg id
177 f6affe3fbfaa+ tip
177 f6affe3fbfaa+ tip
178 $ hg -R s ci -mc
178 $ hg -R s ci -mc
179 $ hg id
179 $ hg id
180 f6affe3fbfaa+ tip
180 f6affe3fbfaa+ tip
181 $ echo d > s/a
181 $ echo d > s/a
182 $ hg ci -m4
182 $ hg ci -m4
183 committing subrepository s
183 committing subrepository s
184 $ hg tip -R s
184 $ hg tip -R s
185 changeset: 4:02dcf1d70411
185 changeset: 4:02dcf1d70411
186 tag: tip
186 tag: tip
187 user: test
187 user: test
188 date: Thu Jan 01 00:00:00 1970 +0000
188 date: Thu Jan 01 00:00:00 1970 +0000
189 summary: 4
189 summary: 4
190
190
191
191
192 check caching
192 check caching
193
193
194 $ hg co 0
194 $ hg co 0
195 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
195 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
196 $ hg debugsub
196 $ hg debugsub
197
197
198 restore
198 restore
199
199
200 $ hg co
200 $ hg co
201 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
201 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
202 $ hg debugsub
202 $ hg debugsub
203 path s
203 path s
204 source s
204 source s
205 revision 02dcf1d704118aee3ee306ccfa1910850d5b05ef
205 revision 02dcf1d704118aee3ee306ccfa1910850d5b05ef
206
206
207 new branch for merge tests
207 new branch for merge tests
208
208
209 $ hg co 1
209 $ hg co 1
210 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
210 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
211 $ echo t = t >> .hgsub
211 $ echo t = t >> .hgsub
212 $ hg init t
212 $ hg init t
213 $ echo t > t/t
213 $ echo t > t/t
214 $ hg -R t add t
214 $ hg -R t add t
215 adding t/t
215 adding t/t
216
216
217 5
217 5
218
218
219 $ hg ci -m5 # add sub
219 $ hg ci -m5 # add sub
220 committing subrepository t
220 committing subrepository t
221 created new head
221 created new head
222 $ echo t2 > t/t
222 $ echo t2 > t/t
223
223
224 6
224 6
225
225
226 $ hg st -R s
226 $ hg st -R s
227 $ hg ci -m6 # change sub
227 $ hg ci -m6 # change sub
228 committing subrepository t
228 committing subrepository t
229 $ hg debugsub
229 $ hg debugsub
230 path s
230 path s
231 source s
231 source s
232 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
232 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
233 path t
233 path t
234 source t
234 source t
235 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
235 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
236 $ echo t3 > t/t
236 $ echo t3 > t/t
237
237
238 7
238 7
239
239
240 $ hg ci -m7 # change sub again for conflict test
240 $ hg ci -m7 # change sub again for conflict test
241 committing subrepository t
241 committing subrepository t
242 $ hg rm .hgsub
242 $ hg rm .hgsub
243
243
244 8
244 8
245
245
246 $ hg ci -m8 # remove sub
246 $ hg ci -m8 # remove sub
247
247
248 test handling .hgsubstate "removed" explicitly.
248 test handling .hgsubstate "removed" explicitly.
249
249
250 $ hg parents --template '{node}\n{files}\n'
250 $ hg parents --template '{node}\n{files}\n'
251 96615c1dad2dc8e3796d7332c77ce69156f7b78e
251 96615c1dad2dc8e3796d7332c77ce69156f7b78e
252 .hgsub .hgsubstate
252 .hgsub .hgsubstate
253 $ hg rollback -q
253 $ hg rollback -q
254 $ hg remove .hgsubstate
254 $ hg remove .hgsubstate
255 $ hg ci -m8
255 $ hg ci -m8
256 $ hg parents --template '{node}\n{files}\n'
256 $ hg parents --template '{node}\n{files}\n'
257 96615c1dad2dc8e3796d7332c77ce69156f7b78e
257 96615c1dad2dc8e3796d7332c77ce69156f7b78e
258 .hgsub .hgsubstate
258 .hgsub .hgsubstate
259
259
260 merge tests
260 merge tests
261
261
262 $ hg co -C 3
262 $ hg co -C 3
263 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
263 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
264 $ hg merge 5 # test adding
264 $ hg merge 5 # test adding
265 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
265 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
266 (branch merge, don't forget to commit)
266 (branch merge, don't forget to commit)
267 $ hg debugsub
267 $ hg debugsub
268 path s
268 path s
269 source s
269 source s
270 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
270 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
271 path t
271 path t
272 source t
272 source t
273 revision 60ca1237c19474e7a3978b0dc1ca4e6f36d51382
273 revision 60ca1237c19474e7a3978b0dc1ca4e6f36d51382
274 $ hg ci -m9
274 $ hg ci -m9
275 created new head
275 created new head
276 $ hg merge 6 --debug # test change
276 $ hg merge 6 --debug # test change
277 resolving manifests
277 resolving manifests
278 branchmerge: True, force: False, partial: False
278 branchmerge: True, force: False, partial: False
279 ancestor: 1f14a2e2d3ec, local: f0d2028bf86d+, remote: 1831e14459c4
279 ancestor: 1f14a2e2d3ec, local: f0d2028bf86d+, remote: 1831e14459c4
280 starting 4 threads for background file closing (?)
280 starting 4 threads for background file closing (?)
281 .hgsubstate: versions differ -> m (premerge)
281 .hgsubstate: versions differ -> m (premerge)
282 subrepo merge f0d2028bf86d+ 1831e14459c4 1f14a2e2d3ec
282 subrepo merge f0d2028bf86d+ 1831e14459c4 1f14a2e2d3ec
283 subrepo t: other changed, get t:6747d179aa9a688023c4b0cad32e4c92bb7f34ad:hg
283 subrepo t: other changed, get t:6747d179aa9a688023c4b0cad32e4c92bb7f34ad:hg
284 getting subrepo t
284 getting subrepo t
285 resolving manifests
285 resolving manifests
286 branchmerge: False, force: False, partial: False
286 branchmerge: False, force: False, partial: False
287 ancestor: 60ca1237c194, local: 60ca1237c194+, remote: 6747d179aa9a
287 ancestor: 60ca1237c194, local: 60ca1237c194+, remote: 6747d179aa9a
288 t: remote is newer -> g
288 t: remote is newer -> g
289 getting t
289 getting t
290 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
290 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
291 (branch merge, don't forget to commit)
291 (branch merge, don't forget to commit)
292 $ hg debugsub
292 $ hg debugsub
293 path s
293 path s
294 source s
294 source s
295 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
295 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
296 path t
296 path t
297 source t
297 source t
298 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
298 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
299 $ echo conflict > t/t
299 $ echo conflict > t/t
300 $ hg ci -m10
300 $ hg ci -m10
301 committing subrepository t
301 committing subrepository t
302 $ HGMERGE=internal:merge hg merge --debug 7 # test conflict
302 $ HGMERGE=internal:merge hg merge --debug 7 # test conflict
303 resolving manifests
303 resolving manifests
304 branchmerge: True, force: False, partial: False
304 branchmerge: True, force: False, partial: False
305 ancestor: 1831e14459c4, local: e45c8b14af55+, remote: f94576341bcf
305 ancestor: 1831e14459c4, local: e45c8b14af55+, remote: f94576341bcf
306 starting 4 threads for background file closing (?)
306 starting 4 threads for background file closing (?)
307 .hgsubstate: versions differ -> m (premerge)
307 .hgsubstate: versions differ -> m (premerge)
308 subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4
308 subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4
309 subrepo t: both sides changed
309 subrepo t: both sides changed
310 subrepository t diverged (local revision: 20a0db6fbf6c, remote revision: 7af322bc1198)
310 subrepository t diverged (local revision: 20a0db6fbf6c, remote revision: 7af322bc1198)
311 starting 4 threads for background file closing (?)
311 starting 4 threads for background file closing (?)
312 you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev].
312 you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev].
313 what do you want to do? m
313 what do you want to do? m
314 merging subrepository "t"
314 merging subrepository "t"
315 resolving manifests
315 resolving manifests
316 branchmerge: True, force: False, partial: False
316 branchmerge: True, force: False, partial: False
317 ancestor: 6747d179aa9a, local: 20a0db6fbf6c+, remote: 7af322bc1198
317 ancestor: 6747d179aa9a, local: 20a0db6fbf6c+, remote: 7af322bc1198
318 preserving t for resolve of t
318 starting 4 threads for background file closing (?)
319 starting 4 threads for background file closing (?)
319 preserving t for resolve of t
320 t: versions differ -> m (premerge)
320 t: versions differ -> m (premerge)
321 picked tool ':merge' for t (binary False symlink False changedelete False)
321 picked tool ':merge' for t (binary False symlink False changedelete False)
322 merging t
322 merging t
323 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
323 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
324 t: versions differ -> m (merge)
324 t: versions differ -> m (merge)
325 picked tool ':merge' for t (binary False symlink False changedelete False)
325 picked tool ':merge' for t (binary False symlink False changedelete False)
326 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
326 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
327 warning: conflicts while merging t! (edit, then use 'hg resolve --mark')
327 warning: conflicts while merging t! (edit, then use 'hg resolve --mark')
328 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
328 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
329 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
329 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
330 subrepo t: merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg
330 subrepo t: merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg
331 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
331 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
332 (branch merge, don't forget to commit)
332 (branch merge, don't forget to commit)
333
333
334 should conflict
334 should conflict
335
335
336 $ cat t/t
336 $ cat t/t
337 <<<<<<< local: 20a0db6fbf6c - test: 10
337 <<<<<<< local: 20a0db6fbf6c - test: 10
338 conflict
338 conflict
339 =======
339 =======
340 t3
340 t3
341 >>>>>>> other: 7af322bc1198 - test: 7
341 >>>>>>> other: 7af322bc1198 - test: 7
342
342
343 11: remove subrepo t
343 11: remove subrepo t
344
344
345 $ hg co -C 5
345 $ hg co -C 5
346 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
346 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
347 $ hg revert -r 4 .hgsub # remove t
347 $ hg revert -r 4 .hgsub # remove t
348 $ hg ci -m11
348 $ hg ci -m11
349 created new head
349 created new head
350 $ hg debugsub
350 $ hg debugsub
351 path s
351 path s
352 source s
352 source s
353 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
353 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
354
354
355 local removed, remote changed, keep changed
355 local removed, remote changed, keep changed
356
356
357 $ hg merge 6
357 $ hg merge 6
358 remote [merge rev] changed subrepository t which local [working copy] removed
358 remote [merge rev] changed subrepository t which local [working copy] removed
359 use (c)hanged version or (d)elete? c
359 use (c)hanged version or (d)elete? c
360 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
360 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
361 (branch merge, don't forget to commit)
361 (branch merge, don't forget to commit)
362 BROKEN: should include subrepo t
362 BROKEN: should include subrepo t
363 $ hg debugsub
363 $ hg debugsub
364 path s
364 path s
365 source s
365 source s
366 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
366 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
367 $ cat .hgsubstate
367 $ cat .hgsubstate
368 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
368 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
369 6747d179aa9a688023c4b0cad32e4c92bb7f34ad t
369 6747d179aa9a688023c4b0cad32e4c92bb7f34ad t
370 $ hg ci -m 'local removed, remote changed, keep changed'
370 $ hg ci -m 'local removed, remote changed, keep changed'
371 BROKEN: should include subrepo t
371 BROKEN: should include subrepo t
372 $ hg debugsub
372 $ hg debugsub
373 path s
373 path s
374 source s
374 source s
375 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
375 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
376 BROKEN: should include subrepo t
376 BROKEN: should include subrepo t
377 $ cat .hgsubstate
377 $ cat .hgsubstate
378 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
378 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
379 $ cat t/t
379 $ cat t/t
380 t2
380 t2
381
381
382 local removed, remote changed, keep removed
382 local removed, remote changed, keep removed
383
383
384 $ hg co -C 11
384 $ hg co -C 11
385 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
385 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
386 $ hg merge --config ui.interactive=true 6 <<EOF
386 $ hg merge --config ui.interactive=true 6 <<EOF
387 > d
387 > d
388 > EOF
388 > EOF
389 remote [merge rev] changed subrepository t which local [working copy] removed
389 remote [merge rev] changed subrepository t which local [working copy] removed
390 use (c)hanged version or (d)elete? d
390 use (c)hanged version or (d)elete? d
391 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
391 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
392 (branch merge, don't forget to commit)
392 (branch merge, don't forget to commit)
393 $ hg debugsub
393 $ hg debugsub
394 path s
394 path s
395 source s
395 source s
396 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
396 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
397 $ cat .hgsubstate
397 $ cat .hgsubstate
398 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
398 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
399 $ hg ci -m 'local removed, remote changed, keep removed'
399 $ hg ci -m 'local removed, remote changed, keep removed'
400 created new head
400 created new head
401 $ hg debugsub
401 $ hg debugsub
402 path s
402 path s
403 source s
403 source s
404 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
404 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
405 $ cat .hgsubstate
405 $ cat .hgsubstate
406 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
406 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
407
407
408 local changed, remote removed, keep changed
408 local changed, remote removed, keep changed
409
409
410 $ hg co -C 6
410 $ hg co -C 6
411 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
411 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
412 $ hg merge 11
412 $ hg merge 11
413 local [working copy] changed subrepository t which remote [merge rev] removed
413 local [working copy] changed subrepository t which remote [merge rev] removed
414 use (c)hanged version or (d)elete? c
414 use (c)hanged version or (d)elete? c
415 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
415 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
416 (branch merge, don't forget to commit)
416 (branch merge, don't forget to commit)
417 BROKEN: should include subrepo t
417 BROKEN: should include subrepo t
418 $ hg debugsub
418 $ hg debugsub
419 path s
419 path s
420 source s
420 source s
421 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
421 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
422 BROKEN: should include subrepo t
422 BROKEN: should include subrepo t
423 $ cat .hgsubstate
423 $ cat .hgsubstate
424 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
424 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
425 $ hg ci -m 'local changed, remote removed, keep changed'
425 $ hg ci -m 'local changed, remote removed, keep changed'
426 created new head
426 created new head
427 BROKEN: should include subrepo t
427 BROKEN: should include subrepo t
428 $ hg debugsub
428 $ hg debugsub
429 path s
429 path s
430 source s
430 source s
431 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
431 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
432 BROKEN: should include subrepo t
432 BROKEN: should include subrepo t
433 $ cat .hgsubstate
433 $ cat .hgsubstate
434 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
434 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
435 $ cat t/t
435 $ cat t/t
436 t2
436 t2
437
437
438 local changed, remote removed, keep removed
438 local changed, remote removed, keep removed
439
439
440 $ hg co -C 6
440 $ hg co -C 6
441 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
441 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
442 $ hg merge --config ui.interactive=true 11 <<EOF
442 $ hg merge --config ui.interactive=true 11 <<EOF
443 > d
443 > d
444 > EOF
444 > EOF
445 local [working copy] changed subrepository t which remote [merge rev] removed
445 local [working copy] changed subrepository t which remote [merge rev] removed
446 use (c)hanged version or (d)elete? d
446 use (c)hanged version or (d)elete? d
447 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
447 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
448 (branch merge, don't forget to commit)
448 (branch merge, don't forget to commit)
449 $ hg debugsub
449 $ hg debugsub
450 path s
450 path s
451 source s
451 source s
452 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
452 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
453 $ cat .hgsubstate
453 $ cat .hgsubstate
454 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
454 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
455 $ hg ci -m 'local changed, remote removed, keep removed'
455 $ hg ci -m 'local changed, remote removed, keep removed'
456 created new head
456 created new head
457 $ hg debugsub
457 $ hg debugsub
458 path s
458 path s
459 source s
459 source s
460 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
460 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
461 $ cat .hgsubstate
461 $ cat .hgsubstate
462 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
462 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
463
463
464 clean up to avoid having to fix up the tests below
464 clean up to avoid having to fix up the tests below
465
465
466 $ hg co -C 10
466 $ hg co -C 10
467 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
467 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
468 $ cat >> $HGRCPATH <<EOF
468 $ cat >> $HGRCPATH <<EOF
469 > [extensions]
469 > [extensions]
470 > strip=
470 > strip=
471 > EOF
471 > EOF
472 $ hg strip -r 11:15
472 $ hg strip -r 11:15
473 saved backup bundle to $TESTTMP/t/.hg/strip-backup/*-backup.hg (glob)
473 saved backup bundle to $TESTTMP/t/.hg/strip-backup/*-backup.hg (glob)
474
474
475 clone
475 clone
476
476
477 $ cd ..
477 $ cd ..
478 $ hg clone t tc
478 $ hg clone t tc
479 updating to branch default
479 updating to branch default
480 cloning subrepo s from $TESTTMP/t/s
480 cloning subrepo s from $TESTTMP/t/s
481 cloning subrepo s/ss from $TESTTMP/t/s/ss
481 cloning subrepo s/ss from $TESTTMP/t/s/ss
482 cloning subrepo t from $TESTTMP/t/t
482 cloning subrepo t from $TESTTMP/t/t
483 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
483 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
484 $ cd tc
484 $ cd tc
485 $ hg debugsub
485 $ hg debugsub
486 path s
486 path s
487 source s
487 source s
488 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
488 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
489 path t
489 path t
490 source t
490 source t
491 revision 20a0db6fbf6c3d2836e6519a642ae929bfc67c0e
491 revision 20a0db6fbf6c3d2836e6519a642ae929bfc67c0e
492 $ cd ..
492 $ cd ..
493
493
494 clone with subrepo disabled (update should fail)
494 clone with subrepo disabled (update should fail)
495
495
496 $ hg clone t -U tc2 --config subrepos.allowed=false
496 $ hg clone t -U tc2 --config subrepos.allowed=false
497 $ hg update -R tc2 --config subrepos.allowed=false
497 $ hg update -R tc2 --config subrepos.allowed=false
498 abort: subrepos not enabled
498 abort: subrepos not enabled
499 (see 'hg help config.subrepos' for details)
499 (see 'hg help config.subrepos' for details)
500 [255]
500 [255]
501 $ ls tc2
501 $ ls tc2
502 a
502 a
503
503
504 $ hg clone t tc3 --config subrepos.allowed=false
504 $ hg clone t tc3 --config subrepos.allowed=false
505 updating to branch default
505 updating to branch default
506 abort: subrepos not enabled
506 abort: subrepos not enabled
507 (see 'hg help config.subrepos' for details)
507 (see 'hg help config.subrepos' for details)
508 [255]
508 [255]
509 $ ls tc3
509 $ ls tc3
510 a
510 a
511
511
512 And again with just the hg type disabled
512 And again with just the hg type disabled
513
513
514 $ hg clone t -U tc4 --config subrepos.hg:allowed=false
514 $ hg clone t -U tc4 --config subrepos.hg:allowed=false
515 $ hg update -R tc4 --config subrepos.hg:allowed=false
515 $ hg update -R tc4 --config subrepos.hg:allowed=false
516 abort: hg subrepos not allowed
516 abort: hg subrepos not allowed
517 (see 'hg help config.subrepos' for details)
517 (see 'hg help config.subrepos' for details)
518 [255]
518 [255]
519 $ ls tc4
519 $ ls tc4
520 a
520 a
521
521
522 $ hg clone t tc5 --config subrepos.hg:allowed=false
522 $ hg clone t tc5 --config subrepos.hg:allowed=false
523 updating to branch default
523 updating to branch default
524 abort: hg subrepos not allowed
524 abort: hg subrepos not allowed
525 (see 'hg help config.subrepos' for details)
525 (see 'hg help config.subrepos' for details)
526 [255]
526 [255]
527 $ ls tc5
527 $ ls tc5
528 a
528 a
529
529
530 push
530 push
531
531
532 $ cd tc
532 $ cd tc
533 $ echo bah > t/t
533 $ echo bah > t/t
534 $ hg ci -m11
534 $ hg ci -m11
535 committing subrepository t
535 committing subrepository t
536 $ hg push
536 $ hg push
537 pushing to $TESTTMP/t
537 pushing to $TESTTMP/t
538 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss
538 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss
539 no changes made to subrepo s since last push to $TESTTMP/t/s
539 no changes made to subrepo s since last push to $TESTTMP/t/s
540 pushing subrepo t to $TESTTMP/t/t
540 pushing subrepo t to $TESTTMP/t/t
541 searching for changes
541 searching for changes
542 adding changesets
542 adding changesets
543 adding manifests
543 adding manifests
544 adding file changes
544 adding file changes
545 added 1 changesets with 1 changes to 1 files
545 added 1 changesets with 1 changes to 1 files
546 searching for changes
546 searching for changes
547 adding changesets
547 adding changesets
548 adding manifests
548 adding manifests
549 adding file changes
549 adding file changes
550 added 1 changesets with 1 changes to 1 files
550 added 1 changesets with 1 changes to 1 files
551
551
552 push -f
552 push -f
553
553
554 $ echo bah > s/a
554 $ echo bah > s/a
555 $ hg ci -m12
555 $ hg ci -m12
556 committing subrepository s
556 committing subrepository s
557 $ hg push
557 $ hg push
558 pushing to $TESTTMP/t
558 pushing to $TESTTMP/t
559 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss
559 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss
560 pushing subrepo s to $TESTTMP/t/s
560 pushing subrepo s to $TESTTMP/t/s
561 searching for changes
561 searching for changes
562 abort: push creates new remote head 12a213df6fa9! (in subrepository "s")
562 abort: push creates new remote head 12a213df6fa9! (in subrepository "s")
563 (merge or see 'hg help push' for details about pushing new heads)
563 (merge or see 'hg help push' for details about pushing new heads)
564 [255]
564 [255]
565 $ hg push -f
565 $ hg push -f
566 pushing to $TESTTMP/t
566 pushing to $TESTTMP/t
567 pushing subrepo s/ss to $TESTTMP/t/s/ss
567 pushing subrepo s/ss to $TESTTMP/t/s/ss
568 searching for changes
568 searching for changes
569 no changes found
569 no changes found
570 pushing subrepo s to $TESTTMP/t/s
570 pushing subrepo s to $TESTTMP/t/s
571 searching for changes
571 searching for changes
572 adding changesets
572 adding changesets
573 adding manifests
573 adding manifests
574 adding file changes
574 adding file changes
575 added 1 changesets with 1 changes to 1 files (+1 heads)
575 added 1 changesets with 1 changes to 1 files (+1 heads)
576 pushing subrepo t to $TESTTMP/t/t
576 pushing subrepo t to $TESTTMP/t/t
577 searching for changes
577 searching for changes
578 no changes found
578 no changes found
579 searching for changes
579 searching for changes
580 adding changesets
580 adding changesets
581 adding manifests
581 adding manifests
582 adding file changes
582 adding file changes
583 added 1 changesets with 1 changes to 1 files
583 added 1 changesets with 1 changes to 1 files
584
584
585 check that unmodified subrepos are not pushed
585 check that unmodified subrepos are not pushed
586
586
587 $ hg clone . ../tcc
587 $ hg clone . ../tcc
588 updating to branch default
588 updating to branch default
589 cloning subrepo s from $TESTTMP/tc/s
589 cloning subrepo s from $TESTTMP/tc/s
590 cloning subrepo s/ss from $TESTTMP/tc/s/ss
590 cloning subrepo s/ss from $TESTTMP/tc/s/ss
591 cloning subrepo t from $TESTTMP/tc/t
591 cloning subrepo t from $TESTTMP/tc/t
592 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
592 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
593
593
594 the subrepos on the new clone have nothing to push to its source
594 the subrepos on the new clone have nothing to push to its source
595
595
596 $ hg push -R ../tcc .
596 $ hg push -R ../tcc .
597 pushing to .
597 pushing to .
598 no changes made to subrepo s/ss since last push to s/ss
598 no changes made to subrepo s/ss since last push to s/ss
599 no changes made to subrepo s since last push to s
599 no changes made to subrepo s since last push to s
600 no changes made to subrepo t since last push to t
600 no changes made to subrepo t since last push to t
601 searching for changes
601 searching for changes
602 no changes found
602 no changes found
603 [1]
603 [1]
604
604
605 the subrepos on the source do not have a clean store versus the clone target
605 the subrepos on the source do not have a clean store versus the clone target
606 because they were never explicitly pushed to the source
606 because they were never explicitly pushed to the source
607
607
608 $ hg push ../tcc
608 $ hg push ../tcc
609 pushing to ../tcc
609 pushing to ../tcc
610 pushing subrepo s/ss to ../tcc/s/ss
610 pushing subrepo s/ss to ../tcc/s/ss
611 searching for changes
611 searching for changes
612 no changes found
612 no changes found
613 pushing subrepo s to ../tcc/s
613 pushing subrepo s to ../tcc/s
614 searching for changes
614 searching for changes
615 no changes found
615 no changes found
616 pushing subrepo t to ../tcc/t
616 pushing subrepo t to ../tcc/t
617 searching for changes
617 searching for changes
618 no changes found
618 no changes found
619 searching for changes
619 searching for changes
620 no changes found
620 no changes found
621 [1]
621 [1]
622
622
623 after push their stores become clean
623 after push their stores become clean
624
624
625 $ hg push ../tcc
625 $ hg push ../tcc
626 pushing to ../tcc
626 pushing to ../tcc
627 no changes made to subrepo s/ss since last push to ../tcc/s/ss
627 no changes made to subrepo s/ss since last push to ../tcc/s/ss
628 no changes made to subrepo s since last push to ../tcc/s
628 no changes made to subrepo s since last push to ../tcc/s
629 no changes made to subrepo t since last push to ../tcc/t
629 no changes made to subrepo t since last push to ../tcc/t
630 searching for changes
630 searching for changes
631 no changes found
631 no changes found
632 [1]
632 [1]
633
633
634 updating a subrepo to a different revision or changing
634 updating a subrepo to a different revision or changing
635 its working directory does not make its store dirty
635 its working directory does not make its store dirty
636
636
637 $ hg -R s update '.^'
637 $ hg -R s update '.^'
638 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
638 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
639 $ hg push
639 $ hg push
640 pushing to $TESTTMP/t
640 pushing to $TESTTMP/t
641 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss
641 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss
642 no changes made to subrepo s since last push to $TESTTMP/t/s
642 no changes made to subrepo s since last push to $TESTTMP/t/s
643 no changes made to subrepo t since last push to $TESTTMP/t/t
643 no changes made to subrepo t since last push to $TESTTMP/t/t
644 searching for changes
644 searching for changes
645 no changes found
645 no changes found
646 [1]
646 [1]
647 $ echo foo >> s/a
647 $ echo foo >> s/a
648 $ hg push
648 $ hg push
649 pushing to $TESTTMP/t
649 pushing to $TESTTMP/t
650 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss
650 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss
651 no changes made to subrepo s since last push to $TESTTMP/t/s
651 no changes made to subrepo s since last push to $TESTTMP/t/s
652 no changes made to subrepo t since last push to $TESTTMP/t/t
652 no changes made to subrepo t since last push to $TESTTMP/t/t
653 searching for changes
653 searching for changes
654 no changes found
654 no changes found
655 [1]
655 [1]
656 $ hg -R s update -C tip
656 $ hg -R s update -C tip
657 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
657 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
658
658
659 committing into a subrepo makes its store (but not its parent's store) dirty
659 committing into a subrepo makes its store (but not its parent's store) dirty
660
660
661 $ echo foo >> s/ss/a
661 $ echo foo >> s/ss/a
662 $ hg -R s/ss commit -m 'test dirty store detection'
662 $ hg -R s/ss commit -m 'test dirty store detection'
663
663
664 $ hg out -S -r `hg log -r tip -T "{node|short}"`
664 $ hg out -S -r `hg log -r tip -T "{node|short}"`
665 comparing with $TESTTMP/t
665 comparing with $TESTTMP/t
666 searching for changes
666 searching for changes
667 no changes found
667 no changes found
668 comparing with $TESTTMP/t/s
668 comparing with $TESTTMP/t/s
669 searching for changes
669 searching for changes
670 no changes found
670 no changes found
671 comparing with $TESTTMP/t/s/ss
671 comparing with $TESTTMP/t/s/ss
672 searching for changes
672 searching for changes
673 changeset: 1:79ea5566a333
673 changeset: 1:79ea5566a333
674 tag: tip
674 tag: tip
675 user: test
675 user: test
676 date: Thu Jan 01 00:00:00 1970 +0000
676 date: Thu Jan 01 00:00:00 1970 +0000
677 summary: test dirty store detection
677 summary: test dirty store detection
678
678
679 comparing with $TESTTMP/t/t
679 comparing with $TESTTMP/t/t
680 searching for changes
680 searching for changes
681 no changes found
681 no changes found
682
682
683 $ hg push
683 $ hg push
684 pushing to $TESTTMP/t
684 pushing to $TESTTMP/t
685 pushing subrepo s/ss to $TESTTMP/t/s/ss
685 pushing subrepo s/ss to $TESTTMP/t/s/ss
686 searching for changes
686 searching for changes
687 adding changesets
687 adding changesets
688 adding manifests
688 adding manifests
689 adding file changes
689 adding file changes
690 added 1 changesets with 1 changes to 1 files
690 added 1 changesets with 1 changes to 1 files
691 no changes made to subrepo s since last push to $TESTTMP/t/s
691 no changes made to subrepo s since last push to $TESTTMP/t/s
692 no changes made to subrepo t since last push to $TESTTMP/t/t
692 no changes made to subrepo t since last push to $TESTTMP/t/t
693 searching for changes
693 searching for changes
694 no changes found
694 no changes found
695 [1]
695 [1]
696
696
697 a subrepo store may be clean versus one repo but not versus another
697 a subrepo store may be clean versus one repo but not versus another
698
698
699 $ hg push
699 $ hg push
700 pushing to $TESTTMP/t
700 pushing to $TESTTMP/t
701 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss
701 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss
702 no changes made to subrepo s since last push to $TESTTMP/t/s
702 no changes made to subrepo s since last push to $TESTTMP/t/s
703 no changes made to subrepo t since last push to $TESTTMP/t/t
703 no changes made to subrepo t since last push to $TESTTMP/t/t
704 searching for changes
704 searching for changes
705 no changes found
705 no changes found
706 [1]
706 [1]
707 $ hg push ../tcc
707 $ hg push ../tcc
708 pushing to ../tcc
708 pushing to ../tcc
709 pushing subrepo s/ss to ../tcc/s/ss
709 pushing subrepo s/ss to ../tcc/s/ss
710 searching for changes
710 searching for changes
711 adding changesets
711 adding changesets
712 adding manifests
712 adding manifests
713 adding file changes
713 adding file changes
714 added 1 changesets with 1 changes to 1 files
714 added 1 changesets with 1 changes to 1 files
715 no changes made to subrepo s since last push to ../tcc/s
715 no changes made to subrepo s since last push to ../tcc/s
716 no changes made to subrepo t since last push to ../tcc/t
716 no changes made to subrepo t since last push to ../tcc/t
717 searching for changes
717 searching for changes
718 no changes found
718 no changes found
719 [1]
719 [1]
720
720
721 update
721 update
722
722
723 $ cd ../t
723 $ cd ../t
724 $ hg up -C # discard our earlier merge
724 $ hg up -C # discard our earlier merge
725 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
725 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
726 updated to "c373c8102e68: 12"
726 updated to "c373c8102e68: 12"
727 2 other heads for branch "default"
727 2 other heads for branch "default"
728 $ echo blah > t/t
728 $ echo blah > t/t
729 $ hg ci -m13
729 $ hg ci -m13
730 committing subrepository t
730 committing subrepository t
731
731
732 backout calls revert internally with minimal opts, which should not raise
732 backout calls revert internally with minimal opts, which should not raise
733 KeyError
733 KeyError
734
734
735 $ hg backout ".^" --no-commit
735 $ hg backout ".^" --no-commit
736 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
736 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
737 changeset c373c8102e68 backed out, don't forget to commit.
737 changeset c373c8102e68 backed out, don't forget to commit.
738
738
739 $ hg up -C # discard changes
739 $ hg up -C # discard changes
740 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
740 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
741 updated to "925c17564ef8: 13"
741 updated to "925c17564ef8: 13"
742 2 other heads for branch "default"
742 2 other heads for branch "default"
743
743
744 pull
744 pull
745
745
746 $ cd ../tc
746 $ cd ../tc
747 $ hg pull
747 $ hg pull
748 pulling from $TESTTMP/t
748 pulling from $TESTTMP/t
749 searching for changes
749 searching for changes
750 adding changesets
750 adding changesets
751 adding manifests
751 adding manifests
752 adding file changes
752 adding file changes
753 added 1 changesets with 1 changes to 1 files
753 added 1 changesets with 1 changes to 1 files
754 new changesets 925c17564ef8
754 new changesets 925c17564ef8
755 (run 'hg update' to get a working copy)
755 (run 'hg update' to get a working copy)
756
756
757 should pull t
757 should pull t
758
758
759 $ hg incoming -S -r `hg log -r tip -T "{node|short}"`
759 $ hg incoming -S -r `hg log -r tip -T "{node|short}"`
760 comparing with $TESTTMP/t
760 comparing with $TESTTMP/t
761 no changes found
761 no changes found
762 comparing with $TESTTMP/t/s
762 comparing with $TESTTMP/t/s
763 searching for changes
763 searching for changes
764 no changes found
764 no changes found
765 comparing with $TESTTMP/t/s/ss
765 comparing with $TESTTMP/t/s/ss
766 searching for changes
766 searching for changes
767 no changes found
767 no changes found
768 comparing with $TESTTMP/t/t
768 comparing with $TESTTMP/t/t
769 searching for changes
769 searching for changes
770 changeset: 5:52c0adc0515a
770 changeset: 5:52c0adc0515a
771 tag: tip
771 tag: tip
772 user: test
772 user: test
773 date: Thu Jan 01 00:00:00 1970 +0000
773 date: Thu Jan 01 00:00:00 1970 +0000
774 summary: 13
774 summary: 13
775
775
776
776
777 $ hg up
777 $ hg up
778 pulling subrepo t from $TESTTMP/t/t
778 pulling subrepo t from $TESTTMP/t/t
779 searching for changes
779 searching for changes
780 adding changesets
780 adding changesets
781 adding manifests
781 adding manifests
782 adding file changes
782 adding file changes
783 added 1 changesets with 1 changes to 1 files
783 added 1 changesets with 1 changes to 1 files
784 new changesets 52c0adc0515a
784 new changesets 52c0adc0515a
785 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
785 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
786 updated to "925c17564ef8: 13"
786 updated to "925c17564ef8: 13"
787 2 other heads for branch "default"
787 2 other heads for branch "default"
788 $ cat t/t
788 $ cat t/t
789 blah
789 blah
790
790
791 bogus subrepo path aborts
791 bogus subrepo path aborts
792
792
793 $ echo 'bogus=[boguspath' >> .hgsub
793 $ echo 'bogus=[boguspath' >> .hgsub
794 $ hg ci -m 'bogus subrepo path'
794 $ hg ci -m 'bogus subrepo path'
795 abort: missing ] in subrepository source
795 abort: missing ] in subrepository source
796 [255]
796 [255]
797
797
798 Issue1986: merge aborts when trying to merge a subrepo that
798 Issue1986: merge aborts when trying to merge a subrepo that
799 shouldn't need merging
799 shouldn't need merging
800
800
801 # subrepo layout
801 # subrepo layout
802 #
802 #
803 # o 5 br
803 # o 5 br
804 # /|
804 # /|
805 # o | 4 default
805 # o | 4 default
806 # | |
806 # | |
807 # | o 3 br
807 # | o 3 br
808 # |/|
808 # |/|
809 # o | 2 default
809 # o | 2 default
810 # | |
810 # | |
811 # | o 1 br
811 # | o 1 br
812 # |/
812 # |/
813 # o 0 default
813 # o 0 default
814
814
815 $ cd ..
815 $ cd ..
816 $ rm -rf sub
816 $ rm -rf sub
817 $ hg init main
817 $ hg init main
818 $ cd main
818 $ cd main
819 $ hg init s
819 $ hg init s
820 $ cd s
820 $ cd s
821 $ echo a > a
821 $ echo a > a
822 $ hg ci -Am1
822 $ hg ci -Am1
823 adding a
823 adding a
824 $ hg branch br
824 $ hg branch br
825 marked working directory as branch br
825 marked working directory as branch br
826 (branches are permanent and global, did you want a bookmark?)
826 (branches are permanent and global, did you want a bookmark?)
827 $ echo a >> a
827 $ echo a >> a
828 $ hg ci -m1
828 $ hg ci -m1
829 $ hg up default
829 $ hg up default
830 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
830 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
831 $ echo b > b
831 $ echo b > b
832 $ hg ci -Am1
832 $ hg ci -Am1
833 adding b
833 adding b
834 $ hg up br
834 $ hg up br
835 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
835 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
836 $ hg merge tip
836 $ hg merge tip
837 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
837 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
838 (branch merge, don't forget to commit)
838 (branch merge, don't forget to commit)
839 $ hg ci -m1
839 $ hg ci -m1
840 $ hg up 2
840 $ hg up 2
841 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
841 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
842 $ echo c > c
842 $ echo c > c
843 $ hg ci -Am1
843 $ hg ci -Am1
844 adding c
844 adding c
845 $ hg up 3
845 $ hg up 3
846 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
846 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
847 $ hg merge 4
847 $ hg merge 4
848 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
848 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
849 (branch merge, don't forget to commit)
849 (branch merge, don't forget to commit)
850 $ hg ci -m1
850 $ hg ci -m1
851
851
852 # main repo layout:
852 # main repo layout:
853 #
853 #
854 # * <-- try to merge default into br again
854 # * <-- try to merge default into br again
855 # .`|
855 # .`|
856 # . o 5 br --> substate = 5
856 # . o 5 br --> substate = 5
857 # . |
857 # . |
858 # o | 4 default --> substate = 4
858 # o | 4 default --> substate = 4
859 # | |
859 # | |
860 # | o 3 br --> substate = 2
860 # | o 3 br --> substate = 2
861 # |/|
861 # |/|
862 # o | 2 default --> substate = 2
862 # o | 2 default --> substate = 2
863 # | |
863 # | |
864 # | o 1 br --> substate = 3
864 # | o 1 br --> substate = 3
865 # |/
865 # |/
866 # o 0 default --> substate = 2
866 # o 0 default --> substate = 2
867
867
868 $ cd ..
868 $ cd ..
869 $ echo 's = s' > .hgsub
869 $ echo 's = s' > .hgsub
870 $ hg -R s up 2
870 $ hg -R s up 2
871 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
871 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
872 $ hg ci -Am1
872 $ hg ci -Am1
873 adding .hgsub
873 adding .hgsub
874 $ hg branch br
874 $ hg branch br
875 marked working directory as branch br
875 marked working directory as branch br
876 (branches are permanent and global, did you want a bookmark?)
876 (branches are permanent and global, did you want a bookmark?)
877 $ echo b > b
877 $ echo b > b
878 $ hg -R s up 3
878 $ hg -R s up 3
879 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
879 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
880 $ hg ci -Am1
880 $ hg ci -Am1
881 adding b
881 adding b
882 $ hg up default
882 $ hg up default
883 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
883 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
884 $ echo c > c
884 $ echo c > c
885 $ hg ci -Am1
885 $ hg ci -Am1
886 adding c
886 adding c
887 $ hg up 1
887 $ hg up 1
888 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
888 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
889 $ hg merge 2
889 $ hg merge 2
890 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
890 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
891 (branch merge, don't forget to commit)
891 (branch merge, don't forget to commit)
892 $ hg ci -m1
892 $ hg ci -m1
893 $ hg up 2
893 $ hg up 2
894 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
894 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
895 $ hg -R s up 4
895 $ hg -R s up 4
896 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
896 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
897 $ echo d > d
897 $ echo d > d
898 $ hg ci -Am1
898 $ hg ci -Am1
899 adding d
899 adding d
900 $ hg up 3
900 $ hg up 3
901 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
901 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
902 $ hg -R s up 5
902 $ hg -R s up 5
903 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
903 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
904 $ echo e > e
904 $ echo e > e
905 $ hg ci -Am1
905 $ hg ci -Am1
906 adding e
906 adding e
907
907
908 $ hg up 5
908 $ hg up 5
909 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
909 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
910 $ hg merge 4 # try to merge default into br again
910 $ hg merge 4 # try to merge default into br again
911 subrepository s diverged (local revision: f8f13b33206e, remote revision: a3f9062a4f88)
911 subrepository s diverged (local revision: f8f13b33206e, remote revision: a3f9062a4f88)
912 you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev].
912 you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev].
913 what do you want to do? m
913 what do you want to do? m
914 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
914 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
915 (branch merge, don't forget to commit)
915 (branch merge, don't forget to commit)
916 $ cd ..
916 $ cd ..
917
917
918 test subrepo delete from .hgsubstate
918 test subrepo delete from .hgsubstate
919
919
920 $ hg init testdelete
920 $ hg init testdelete
921 $ mkdir testdelete/nested testdelete/nested2
921 $ mkdir testdelete/nested testdelete/nested2
922 $ hg init testdelete/nested
922 $ hg init testdelete/nested
923 $ hg init testdelete/nested2
923 $ hg init testdelete/nested2
924 $ echo test > testdelete/nested/foo
924 $ echo test > testdelete/nested/foo
925 $ echo test > testdelete/nested2/foo
925 $ echo test > testdelete/nested2/foo
926 $ hg -R testdelete/nested add
926 $ hg -R testdelete/nested add
927 adding testdelete/nested/foo
927 adding testdelete/nested/foo
928 $ hg -R testdelete/nested2 add
928 $ hg -R testdelete/nested2 add
929 adding testdelete/nested2/foo
929 adding testdelete/nested2/foo
930 $ hg -R testdelete/nested ci -m test
930 $ hg -R testdelete/nested ci -m test
931 $ hg -R testdelete/nested2 ci -m test
931 $ hg -R testdelete/nested2 ci -m test
932 $ echo nested = nested > testdelete/.hgsub
932 $ echo nested = nested > testdelete/.hgsub
933 $ echo nested2 = nested2 >> testdelete/.hgsub
933 $ echo nested2 = nested2 >> testdelete/.hgsub
934 $ hg -R testdelete add
934 $ hg -R testdelete add
935 adding testdelete/.hgsub
935 adding testdelete/.hgsub
936 $ hg -R testdelete ci -m "nested 1 & 2 added"
936 $ hg -R testdelete ci -m "nested 1 & 2 added"
937 $ echo nested = nested > testdelete/.hgsub
937 $ echo nested = nested > testdelete/.hgsub
938 $ hg -R testdelete ci -m "nested 2 deleted"
938 $ hg -R testdelete ci -m "nested 2 deleted"
939 $ cat testdelete/.hgsubstate
939 $ cat testdelete/.hgsubstate
940 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
940 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
941 $ hg -R testdelete remove testdelete/.hgsub
941 $ hg -R testdelete remove testdelete/.hgsub
942 $ hg -R testdelete ci -m ".hgsub deleted"
942 $ hg -R testdelete ci -m ".hgsub deleted"
943 $ cat testdelete/.hgsubstate
943 $ cat testdelete/.hgsubstate
944 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
944 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
945
945
946 test repository cloning
946 test repository cloning
947
947
948 $ mkdir mercurial mercurial2
948 $ mkdir mercurial mercurial2
949 $ hg init nested_absolute
949 $ hg init nested_absolute
950 $ echo test > nested_absolute/foo
950 $ echo test > nested_absolute/foo
951 $ hg -R nested_absolute add
951 $ hg -R nested_absolute add
952 adding nested_absolute/foo
952 adding nested_absolute/foo
953 $ hg -R nested_absolute ci -mtest
953 $ hg -R nested_absolute ci -mtest
954 $ cd mercurial
954 $ cd mercurial
955 $ hg init nested_relative
955 $ hg init nested_relative
956 $ echo test2 > nested_relative/foo2
956 $ echo test2 > nested_relative/foo2
957 $ hg -R nested_relative add
957 $ hg -R nested_relative add
958 adding nested_relative/foo2
958 adding nested_relative/foo2
959 $ hg -R nested_relative ci -mtest2
959 $ hg -R nested_relative ci -mtest2
960 $ hg init main
960 $ hg init main
961 $ echo "nested_relative = ../nested_relative" > main/.hgsub
961 $ echo "nested_relative = ../nested_relative" > main/.hgsub
962 $ echo "nested_absolute = `pwd`/nested_absolute" >> main/.hgsub
962 $ echo "nested_absolute = `pwd`/nested_absolute" >> main/.hgsub
963 $ hg -R main add
963 $ hg -R main add
964 adding main/.hgsub
964 adding main/.hgsub
965 $ hg -R main ci -m "add subrepos"
965 $ hg -R main ci -m "add subrepos"
966 $ cd ..
966 $ cd ..
967 $ hg clone mercurial/main mercurial2/main
967 $ hg clone mercurial/main mercurial2/main
968 updating to branch default
968 updating to branch default
969 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
969 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
970 $ cat mercurial2/main/nested_absolute/.hg/hgrc \
970 $ cat mercurial2/main/nested_absolute/.hg/hgrc \
971 > mercurial2/main/nested_relative/.hg/hgrc
971 > mercurial2/main/nested_relative/.hg/hgrc
972 [paths]
972 [paths]
973 default = $TESTTMP/mercurial/nested_absolute
973 default = $TESTTMP/mercurial/nested_absolute
974 [paths]
974 [paths]
975 default = $TESTTMP/mercurial/nested_relative
975 default = $TESTTMP/mercurial/nested_relative
976 $ rm -rf mercurial mercurial2
976 $ rm -rf mercurial mercurial2
977
977
978 Issue1977: multirepo push should fail if subrepo push fails
978 Issue1977: multirepo push should fail if subrepo push fails
979
979
980 $ hg init repo
980 $ hg init repo
981 $ hg init repo/s
981 $ hg init repo/s
982 $ echo a > repo/s/a
982 $ echo a > repo/s/a
983 $ hg -R repo/s ci -Am0
983 $ hg -R repo/s ci -Am0
984 adding a
984 adding a
985 $ echo s = s > repo/.hgsub
985 $ echo s = s > repo/.hgsub
986 $ hg -R repo ci -Am1
986 $ hg -R repo ci -Am1
987 adding .hgsub
987 adding .hgsub
988 $ hg clone repo repo2
988 $ hg clone repo repo2
989 updating to branch default
989 updating to branch default
990 cloning subrepo s from $TESTTMP/repo/s
990 cloning subrepo s from $TESTTMP/repo/s
991 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
991 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
992 $ hg -q -R repo2 pull -u
992 $ hg -q -R repo2 pull -u
993 $ echo 1 > repo2/s/a
993 $ echo 1 > repo2/s/a
994 $ hg -R repo2/s ci -m2
994 $ hg -R repo2/s ci -m2
995 $ hg -q -R repo2/s push
995 $ hg -q -R repo2/s push
996 $ hg -R repo2/s up -C 0
996 $ hg -R repo2/s up -C 0
997 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
997 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
998 $ echo 2 > repo2/s/b
998 $ echo 2 > repo2/s/b
999 $ hg -R repo2/s ci -m3 -A
999 $ hg -R repo2/s ci -m3 -A
1000 adding b
1000 adding b
1001 created new head
1001 created new head
1002 $ hg -R repo2 ci -m3
1002 $ hg -R repo2 ci -m3
1003 $ hg -q -R repo2 push
1003 $ hg -q -R repo2 push
1004 abort: push creates new remote head cc505f09a8b2! (in subrepository "s")
1004 abort: push creates new remote head cc505f09a8b2! (in subrepository "s")
1005 (merge or see 'hg help push' for details about pushing new heads)
1005 (merge or see 'hg help push' for details about pushing new heads)
1006 [255]
1006 [255]
1007 $ hg -R repo update
1007 $ hg -R repo update
1008 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1008 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1009
1009
1010 test if untracked file is not overwritten
1010 test if untracked file is not overwritten
1011
1011
1012 (this also tests that updated .hgsubstate is treated as "modified",
1012 (this also tests that updated .hgsubstate is treated as "modified",
1013 when 'merge.update()' is aborted before 'merge.recordupdates()', even
1013 when 'merge.update()' is aborted before 'merge.recordupdates()', even
1014 if none of mode, size and timestamp of it isn't changed on the
1014 if none of mode, size and timestamp of it isn't changed on the
1015 filesystem (see also issue4583))
1015 filesystem (see also issue4583))
1016
1016
1017 $ echo issue3276_ok > repo/s/b
1017 $ echo issue3276_ok > repo/s/b
1018 $ hg -R repo2 push -f -q
1018 $ hg -R repo2 push -f -q
1019 $ touch -t 200001010000 repo/.hgsubstate
1019 $ touch -t 200001010000 repo/.hgsubstate
1020
1020
1021 $ cat >> repo/.hg/hgrc <<EOF
1021 $ cat >> repo/.hg/hgrc <<EOF
1022 > [fakedirstatewritetime]
1022 > [fakedirstatewritetime]
1023 > # emulate invoking dirstate.write() via repo.status()
1023 > # emulate invoking dirstate.write() via repo.status()
1024 > # at 2000-01-01 00:00
1024 > # at 2000-01-01 00:00
1025 > fakenow = 200001010000
1025 > fakenow = 200001010000
1026 >
1026 >
1027 > [extensions]
1027 > [extensions]
1028 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
1028 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
1029 > EOF
1029 > EOF
1030 $ hg -R repo update
1030 $ hg -R repo update
1031 b: untracked file differs
1031 b: untracked file differs
1032 abort: untracked files in working directory differ from files in requested revision (in subrepository "s")
1032 abort: untracked files in working directory differ from files in requested revision (in subrepository "s")
1033 [255]
1033 [255]
1034 $ cat >> repo/.hg/hgrc <<EOF
1034 $ cat >> repo/.hg/hgrc <<EOF
1035 > [extensions]
1035 > [extensions]
1036 > fakedirstatewritetime = !
1036 > fakedirstatewritetime = !
1037 > EOF
1037 > EOF
1038
1038
1039 $ cat repo/s/b
1039 $ cat repo/s/b
1040 issue3276_ok
1040 issue3276_ok
1041 $ rm repo/s/b
1041 $ rm repo/s/b
1042 $ touch -t 200001010000 repo/.hgsubstate
1042 $ touch -t 200001010000 repo/.hgsubstate
1043 $ hg -R repo revert --all
1043 $ hg -R repo revert --all
1044 reverting repo/.hgsubstate
1044 reverting repo/.hgsubstate
1045 reverting subrepo s
1045 reverting subrepo s
1046 $ hg -R repo update
1046 $ hg -R repo update
1047 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1047 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1048 $ cat repo/s/b
1048 $ cat repo/s/b
1049 2
1049 2
1050 $ rm -rf repo2 repo
1050 $ rm -rf repo2 repo
1051
1051
1052
1052
1053 Issue1852 subrepos with relative paths always push/pull relative to default
1053 Issue1852 subrepos with relative paths always push/pull relative to default
1054
1054
1055 Prepare a repo with subrepo
1055 Prepare a repo with subrepo
1056
1056
1057 $ hg init issue1852a
1057 $ hg init issue1852a
1058 $ cd issue1852a
1058 $ cd issue1852a
1059 $ hg init sub/repo
1059 $ hg init sub/repo
1060 $ echo test > sub/repo/foo
1060 $ echo test > sub/repo/foo
1061 $ hg -R sub/repo add sub/repo/foo
1061 $ hg -R sub/repo add sub/repo/foo
1062 $ echo sub/repo = sub/repo > .hgsub
1062 $ echo sub/repo = sub/repo > .hgsub
1063 $ hg add .hgsub
1063 $ hg add .hgsub
1064 $ hg ci -mtest
1064 $ hg ci -mtest
1065 committing subrepository sub/repo
1065 committing subrepository sub/repo
1066 $ echo test >> sub/repo/foo
1066 $ echo test >> sub/repo/foo
1067 $ hg ci -mtest
1067 $ hg ci -mtest
1068 committing subrepository sub/repo
1068 committing subrepository sub/repo
1069 $ hg cat sub/repo/foo
1069 $ hg cat sub/repo/foo
1070 test
1070 test
1071 test
1071 test
1072 $ hg cat sub/repo/foo -Tjson | sed 's|\\\\|/|g'
1072 $ hg cat sub/repo/foo -Tjson | sed 's|\\\\|/|g'
1073 [
1073 [
1074 {
1074 {
1075 "data": "test\ntest\n",
1075 "data": "test\ntest\n",
1076 "path": "foo"
1076 "path": "foo"
1077 }
1077 }
1078 ]
1078 ]
1079
1079
1080 non-exact match:
1080 non-exact match:
1081
1081
1082 $ hg cat -T '{path|relpath}\n' 'glob:**'
1082 $ hg cat -T '{path|relpath}\n' 'glob:**'
1083 .hgsub
1083 .hgsub
1084 .hgsubstate
1084 .hgsubstate
1085 sub/repo/foo
1085 sub/repo/foo
1086 $ hg cat -T '{path|relpath}\n' 're:^sub'
1086 $ hg cat -T '{path|relpath}\n' 're:^sub'
1087 sub/repo/foo
1087 sub/repo/foo
1088
1088
1089 missing subrepos in working directory:
1089 missing subrepos in working directory:
1090
1090
1091 $ mkdir -p tmp/sub/repo
1091 $ mkdir -p tmp/sub/repo
1092 $ hg cat -r 0 --output tmp/%p_p sub/repo/foo
1092 $ hg cat -r 0 --output tmp/%p_p sub/repo/foo
1093 $ cat tmp/sub/repo/foo_p
1093 $ cat tmp/sub/repo/foo_p
1094 test
1094 test
1095 $ mv sub/repo sub_
1095 $ mv sub/repo sub_
1096 $ hg cat sub/repo/baz
1096 $ hg cat sub/repo/baz
1097 skipping missing subrepository: sub/repo
1097 skipping missing subrepository: sub/repo
1098 [1]
1098 [1]
1099 $ rm -rf sub/repo
1099 $ rm -rf sub/repo
1100 $ mv sub_ sub/repo
1100 $ mv sub_ sub/repo
1101 $ cd ..
1101 $ cd ..
1102
1102
1103 Create repo without default path, pull top repo, and see what happens on update
1103 Create repo without default path, pull top repo, and see what happens on update
1104
1104
1105 $ hg init issue1852b
1105 $ hg init issue1852b
1106 $ hg -R issue1852b pull issue1852a
1106 $ hg -R issue1852b pull issue1852a
1107 pulling from issue1852a
1107 pulling from issue1852a
1108 requesting all changes
1108 requesting all changes
1109 adding changesets
1109 adding changesets
1110 adding manifests
1110 adding manifests
1111 adding file changes
1111 adding file changes
1112 added 2 changesets with 3 changes to 2 files
1112 added 2 changesets with 3 changes to 2 files
1113 new changesets 19487b456929:be5eb94e7215
1113 new changesets 19487b456929:be5eb94e7215
1114 (run 'hg update' to get a working copy)
1114 (run 'hg update' to get a working copy)
1115 $ hg -R issue1852b update
1115 $ hg -R issue1852b update
1116 abort: default path for subrepository not found (in subrepository "sub/repo")
1116 abort: default path for subrepository not found (in subrepository "sub/repo")
1117 [255]
1117 [255]
1118
1118
1119 Ensure a full traceback, not just the SubrepoAbort part
1119 Ensure a full traceback, not just the SubrepoAbort part
1120
1120
1121 $ hg -R issue1852b update --traceback 2>&1 | grep 'raise error\.Abort'
1121 $ hg -R issue1852b update --traceback 2>&1 | grep 'raise error\.Abort'
1122 raise error.Abort(_("default path for subrepository not found"))
1122 raise error.Abort(_("default path for subrepository not found"))
1123
1123
1124 Pull -u now doesn't help
1124 Pull -u now doesn't help
1125
1125
1126 $ hg -R issue1852b pull -u issue1852a
1126 $ hg -R issue1852b pull -u issue1852a
1127 pulling from issue1852a
1127 pulling from issue1852a
1128 searching for changes
1128 searching for changes
1129 no changes found
1129 no changes found
1130
1130
1131 Try the same, but with pull -u
1131 Try the same, but with pull -u
1132
1132
1133 $ hg init issue1852c
1133 $ hg init issue1852c
1134 $ hg -R issue1852c pull -r0 -u issue1852a
1134 $ hg -R issue1852c pull -r0 -u issue1852a
1135 pulling from issue1852a
1135 pulling from issue1852a
1136 adding changesets
1136 adding changesets
1137 adding manifests
1137 adding manifests
1138 adding file changes
1138 adding file changes
1139 added 1 changesets with 2 changes to 2 files
1139 added 1 changesets with 2 changes to 2 files
1140 new changesets 19487b456929
1140 new changesets 19487b456929
1141 cloning subrepo sub/repo from issue1852a/sub/repo
1141 cloning subrepo sub/repo from issue1852a/sub/repo
1142 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1142 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1143
1143
1144 Try to push from the other side
1144 Try to push from the other side
1145
1145
1146 $ hg -R issue1852a push `pwd`/issue1852c
1146 $ hg -R issue1852a push `pwd`/issue1852c
1147 pushing to $TESTTMP/issue1852c
1147 pushing to $TESTTMP/issue1852c
1148 pushing subrepo sub/repo to $TESTTMP/issue1852c/sub/repo
1148 pushing subrepo sub/repo to $TESTTMP/issue1852c/sub/repo
1149 searching for changes
1149 searching for changes
1150 no changes found
1150 no changes found
1151 searching for changes
1151 searching for changes
1152 adding changesets
1152 adding changesets
1153 adding manifests
1153 adding manifests
1154 adding file changes
1154 adding file changes
1155 added 1 changesets with 1 changes to 1 files
1155 added 1 changesets with 1 changes to 1 files
1156
1156
1157 Incoming and outgoing should not use the default path:
1157 Incoming and outgoing should not use the default path:
1158
1158
1159 $ hg clone -q issue1852a issue1852d
1159 $ hg clone -q issue1852a issue1852d
1160 $ hg -R issue1852d outgoing --subrepos issue1852c
1160 $ hg -R issue1852d outgoing --subrepos issue1852c
1161 comparing with issue1852c
1161 comparing with issue1852c
1162 searching for changes
1162 searching for changes
1163 no changes found
1163 no changes found
1164 comparing with issue1852c/sub/repo
1164 comparing with issue1852c/sub/repo
1165 searching for changes
1165 searching for changes
1166 no changes found
1166 no changes found
1167 [1]
1167 [1]
1168 $ hg -R issue1852d incoming --subrepos issue1852c
1168 $ hg -R issue1852d incoming --subrepos issue1852c
1169 comparing with issue1852c
1169 comparing with issue1852c
1170 searching for changes
1170 searching for changes
1171 no changes found
1171 no changes found
1172 comparing with issue1852c/sub/repo
1172 comparing with issue1852c/sub/repo
1173 searching for changes
1173 searching for changes
1174 no changes found
1174 no changes found
1175 [1]
1175 [1]
1176
1176
1177 Check that merge of a new subrepo doesn't write the uncommitted state to
1177 Check that merge of a new subrepo doesn't write the uncommitted state to
1178 .hgsubstate (issue4622)
1178 .hgsubstate (issue4622)
1179
1179
1180 $ hg init issue1852a/addedsub
1180 $ hg init issue1852a/addedsub
1181 $ echo zzz > issue1852a/addedsub/zz.txt
1181 $ echo zzz > issue1852a/addedsub/zz.txt
1182 $ hg -R issue1852a/addedsub ci -Aqm "initial ZZ"
1182 $ hg -R issue1852a/addedsub ci -Aqm "initial ZZ"
1183
1183
1184 $ hg clone issue1852a/addedsub issue1852d/addedsub
1184 $ hg clone issue1852a/addedsub issue1852d/addedsub
1185 updating to branch default
1185 updating to branch default
1186 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1186 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1187
1187
1188 $ echo def > issue1852a/sub/repo/foo
1188 $ echo def > issue1852a/sub/repo/foo
1189 $ hg -R issue1852a ci -SAm 'tweaked subrepo'
1189 $ hg -R issue1852a ci -SAm 'tweaked subrepo'
1190 adding tmp/sub/repo/foo_p
1190 adding tmp/sub/repo/foo_p
1191 committing subrepository sub/repo
1191 committing subrepository sub/repo
1192
1192
1193 $ echo 'addedsub = addedsub' >> issue1852d/.hgsub
1193 $ echo 'addedsub = addedsub' >> issue1852d/.hgsub
1194 $ echo xyz > issue1852d/sub/repo/foo
1194 $ echo xyz > issue1852d/sub/repo/foo
1195 $ hg -R issue1852d pull -u
1195 $ hg -R issue1852d pull -u
1196 pulling from $TESTTMP/issue1852a
1196 pulling from $TESTTMP/issue1852a
1197 searching for changes
1197 searching for changes
1198 adding changesets
1198 adding changesets
1199 adding manifests
1199 adding manifests
1200 adding file changes
1200 adding file changes
1201 added 1 changesets with 2 changes to 2 files
1201 added 1 changesets with 2 changes to 2 files
1202 new changesets c82b79fdcc5b
1202 new changesets c82b79fdcc5b
1203 subrepository sub/repo diverged (local revision: f42d5c7504a8, remote revision: 46cd4aac504c)
1203 subrepository sub/repo diverged (local revision: f42d5c7504a8, remote revision: 46cd4aac504c)
1204 you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination].
1204 you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination].
1205 what do you want to do? m
1205 what do you want to do? m
1206 pulling subrepo sub/repo from $TESTTMP/issue1852a/sub/repo
1206 pulling subrepo sub/repo from $TESTTMP/issue1852a/sub/repo
1207 searching for changes
1207 searching for changes
1208 adding changesets
1208 adding changesets
1209 adding manifests
1209 adding manifests
1210 adding file changes
1210 adding file changes
1211 added 1 changesets with 1 changes to 1 files
1211 added 1 changesets with 1 changes to 1 files
1212 new changesets 46cd4aac504c
1212 new changesets 46cd4aac504c
1213 subrepository sources for sub/repo differ
1213 subrepository sources for sub/repo differ
1214 you can use (l)ocal source (f42d5c7504a8) or (r)emote source (46cd4aac504c).
1214 you can use (l)ocal source (f42d5c7504a8) or (r)emote source (46cd4aac504c).
1215 what do you want to do? l
1215 what do you want to do? l
1216 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1216 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1217 $ cat issue1852d/.hgsubstate
1217 $ cat issue1852d/.hgsubstate
1218 f42d5c7504a811dda50f5cf3e5e16c3330b87172 sub/repo
1218 f42d5c7504a811dda50f5cf3e5e16c3330b87172 sub/repo
1219
1219
1220 Check status of files when none of them belong to the first
1220 Check status of files when none of them belong to the first
1221 subrepository:
1221 subrepository:
1222
1222
1223 $ hg init subrepo-status
1223 $ hg init subrepo-status
1224 $ cd subrepo-status
1224 $ cd subrepo-status
1225 $ hg init subrepo-1
1225 $ hg init subrepo-1
1226 $ hg init subrepo-2
1226 $ hg init subrepo-2
1227 $ cd subrepo-2
1227 $ cd subrepo-2
1228 $ touch file
1228 $ touch file
1229 $ hg add file
1229 $ hg add file
1230 $ cd ..
1230 $ cd ..
1231 $ echo subrepo-1 = subrepo-1 > .hgsub
1231 $ echo subrepo-1 = subrepo-1 > .hgsub
1232 $ echo subrepo-2 = subrepo-2 >> .hgsub
1232 $ echo subrepo-2 = subrepo-2 >> .hgsub
1233 $ hg add .hgsub
1233 $ hg add .hgsub
1234 $ hg ci -m 'Added subrepos'
1234 $ hg ci -m 'Added subrepos'
1235 committing subrepository subrepo-2
1235 committing subrepository subrepo-2
1236 $ hg st subrepo-2/file
1236 $ hg st subrepo-2/file
1237
1237
1238 Check that share works with subrepo
1238 Check that share works with subrepo
1239 $ hg --config extensions.share= share . ../shared
1239 $ hg --config extensions.share= share . ../shared
1240 updating working directory
1240 updating working directory
1241 sharing subrepo subrepo-1 from $TESTTMP/subrepo-status/subrepo-1
1241 sharing subrepo subrepo-1 from $TESTTMP/subrepo-status/subrepo-1
1242 sharing subrepo subrepo-2 from $TESTTMP/subrepo-status/subrepo-2
1242 sharing subrepo subrepo-2 from $TESTTMP/subrepo-status/subrepo-2
1243 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1243 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1244 $ find ../shared/* | sort
1244 $ find ../shared/* | sort
1245 ../shared/subrepo-1
1245 ../shared/subrepo-1
1246 ../shared/subrepo-1/.hg
1246 ../shared/subrepo-1/.hg
1247 ../shared/subrepo-1/.hg/cache
1247 ../shared/subrepo-1/.hg/cache
1248 ../shared/subrepo-1/.hg/cache/storehash
1248 ../shared/subrepo-1/.hg/cache/storehash
1249 ../shared/subrepo-1/.hg/cache/storehash/* (glob)
1249 ../shared/subrepo-1/.hg/cache/storehash/* (glob)
1250 ../shared/subrepo-1/.hg/hgrc
1250 ../shared/subrepo-1/.hg/hgrc
1251 ../shared/subrepo-1/.hg/requires
1251 ../shared/subrepo-1/.hg/requires
1252 ../shared/subrepo-1/.hg/sharedpath
1252 ../shared/subrepo-1/.hg/sharedpath
1253 ../shared/subrepo-1/.hg/wcache
1253 ../shared/subrepo-1/.hg/wcache
1254 ../shared/subrepo-2
1254 ../shared/subrepo-2
1255 ../shared/subrepo-2/.hg
1255 ../shared/subrepo-2/.hg
1256 ../shared/subrepo-2/.hg/branch
1256 ../shared/subrepo-2/.hg/branch
1257 ../shared/subrepo-2/.hg/cache
1257 ../shared/subrepo-2/.hg/cache
1258 ../shared/subrepo-2/.hg/cache/storehash
1258 ../shared/subrepo-2/.hg/cache/storehash
1259 ../shared/subrepo-2/.hg/cache/storehash/* (glob)
1259 ../shared/subrepo-2/.hg/cache/storehash/* (glob)
1260 ../shared/subrepo-2/.hg/dirstate
1260 ../shared/subrepo-2/.hg/dirstate
1261 ../shared/subrepo-2/.hg/hgrc
1261 ../shared/subrepo-2/.hg/hgrc
1262 ../shared/subrepo-2/.hg/requires
1262 ../shared/subrepo-2/.hg/requires
1263 ../shared/subrepo-2/.hg/sharedpath
1263 ../shared/subrepo-2/.hg/sharedpath
1264 ../shared/subrepo-2/.hg/wcache
1264 ../shared/subrepo-2/.hg/wcache
1265 ../shared/subrepo-2/.hg/wcache/checkisexec (execbit !)
1265 ../shared/subrepo-2/.hg/wcache/checkisexec (execbit !)
1266 ../shared/subrepo-2/.hg/wcache/checklink (symlink !)
1266 ../shared/subrepo-2/.hg/wcache/checklink (symlink !)
1267 ../shared/subrepo-2/.hg/wcache/checklink-target (symlink !)
1267 ../shared/subrepo-2/.hg/wcache/checklink-target (symlink !)
1268 ../shared/subrepo-2/.hg/wcache/manifestfulltextcache (reporevlogstore !)
1268 ../shared/subrepo-2/.hg/wcache/manifestfulltextcache (reporevlogstore !)
1269 ../shared/subrepo-2/file
1269 ../shared/subrepo-2/file
1270 $ hg -R ../shared in
1270 $ hg -R ../shared in
1271 abort: repository default not found!
1271 abort: repository default not found!
1272 [255]
1272 [255]
1273 $ hg -R ../shared/subrepo-2 showconfig paths
1273 $ hg -R ../shared/subrepo-2 showconfig paths
1274 paths.default=$TESTTMP/subrepo-status/subrepo-2
1274 paths.default=$TESTTMP/subrepo-status/subrepo-2
1275 $ hg -R ../shared/subrepo-1 sum --remote
1275 $ hg -R ../shared/subrepo-1 sum --remote
1276 parent: -1:000000000000 tip (empty repository)
1276 parent: -1:000000000000 tip (empty repository)
1277 branch: default
1277 branch: default
1278 commit: (clean)
1278 commit: (clean)
1279 update: (current)
1279 update: (current)
1280 remote: (synced)
1280 remote: (synced)
1281
1281
1282 Check hg update --clean
1282 Check hg update --clean
1283 $ cd $TESTTMP/t
1283 $ cd $TESTTMP/t
1284 $ rm -r t/t.orig
1284 $ rm -r t/t.orig
1285 $ hg status -S --all
1285 $ hg status -S --all
1286 C .hgsub
1286 C .hgsub
1287 C .hgsubstate
1287 C .hgsubstate
1288 C a
1288 C a
1289 C s/.hgsub
1289 C s/.hgsub
1290 C s/.hgsubstate
1290 C s/.hgsubstate
1291 C s/a
1291 C s/a
1292 C s/ss/a
1292 C s/ss/a
1293 C t/t
1293 C t/t
1294 $ echo c1 > s/a
1294 $ echo c1 > s/a
1295 $ cd s
1295 $ cd s
1296 $ echo c1 > b
1296 $ echo c1 > b
1297 $ echo c1 > c
1297 $ echo c1 > c
1298 $ hg add b
1298 $ hg add b
1299 $ cd ..
1299 $ cd ..
1300 $ hg status -S
1300 $ hg status -S
1301 M s/a
1301 M s/a
1302 A s/b
1302 A s/b
1303 ? s/c
1303 ? s/c
1304 $ hg update -C
1304 $ hg update -C
1305 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1305 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1306 updated to "925c17564ef8: 13"
1306 updated to "925c17564ef8: 13"
1307 2 other heads for branch "default"
1307 2 other heads for branch "default"
1308 $ hg status -S
1308 $ hg status -S
1309 ? s/b
1309 ? s/b
1310 ? s/c
1310 ? s/c
1311
1311
1312 Sticky subrepositories, no changes
1312 Sticky subrepositories, no changes
1313 $ cd $TESTTMP/t
1313 $ cd $TESTTMP/t
1314 $ hg id
1314 $ hg id
1315 925c17564ef8 tip
1315 925c17564ef8 tip
1316 $ hg -R s id
1316 $ hg -R s id
1317 12a213df6fa9 tip
1317 12a213df6fa9 tip
1318 $ hg -R t id
1318 $ hg -R t id
1319 52c0adc0515a tip
1319 52c0adc0515a tip
1320 $ hg update 11
1320 $ hg update 11
1321 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1321 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1322 $ hg id
1322 $ hg id
1323 365661e5936a
1323 365661e5936a
1324 $ hg -R s id
1324 $ hg -R s id
1325 fc627a69481f
1325 fc627a69481f
1326 $ hg -R t id
1326 $ hg -R t id
1327 e95bcfa18a35
1327 e95bcfa18a35
1328
1328
1329 Sticky subrepositories, file changes
1329 Sticky subrepositories, file changes
1330 $ touch s/f1
1330 $ touch s/f1
1331 $ touch t/f1
1331 $ touch t/f1
1332 $ hg add -S s/f1
1332 $ hg add -S s/f1
1333 $ hg add -S t/f1
1333 $ hg add -S t/f1
1334 $ hg id
1334 $ hg id
1335 365661e5936a+
1335 365661e5936a+
1336 $ hg -R s id
1336 $ hg -R s id
1337 fc627a69481f+
1337 fc627a69481f+
1338 $ hg -R t id
1338 $ hg -R t id
1339 e95bcfa18a35+
1339 e95bcfa18a35+
1340 $ hg update tip
1340 $ hg update tip
1341 subrepository s diverged (local revision: fc627a69481f, remote revision: 12a213df6fa9)
1341 subrepository s diverged (local revision: fc627a69481f, remote revision: 12a213df6fa9)
1342 you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination].
1342 you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination].
1343 what do you want to do? m
1343 what do you want to do? m
1344 subrepository sources for s differ
1344 subrepository sources for s differ
1345 you can use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9).
1345 you can use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9).
1346 what do you want to do? l
1346 what do you want to do? l
1347 subrepository t diverged (local revision: e95bcfa18a35, remote revision: 52c0adc0515a)
1347 subrepository t diverged (local revision: e95bcfa18a35, remote revision: 52c0adc0515a)
1348 you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination].
1348 you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination].
1349 what do you want to do? m
1349 what do you want to do? m
1350 subrepository sources for t differ
1350 subrepository sources for t differ
1351 you can use (l)ocal source (e95bcfa18a35) or (r)emote source (52c0adc0515a).
1351 you can use (l)ocal source (e95bcfa18a35) or (r)emote source (52c0adc0515a).
1352 what do you want to do? l
1352 what do you want to do? l
1353 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1353 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1354 $ hg id
1354 $ hg id
1355 925c17564ef8+ tip
1355 925c17564ef8+ tip
1356 $ hg -R s id
1356 $ hg -R s id
1357 fc627a69481f+
1357 fc627a69481f+
1358 $ hg -R t id
1358 $ hg -R t id
1359 e95bcfa18a35+
1359 e95bcfa18a35+
1360 $ hg update --clean tip
1360 $ hg update --clean tip
1361 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1361 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1362
1362
1363 Sticky subrepository, revision updates
1363 Sticky subrepository, revision updates
1364 $ hg id
1364 $ hg id
1365 925c17564ef8 tip
1365 925c17564ef8 tip
1366 $ hg -R s id
1366 $ hg -R s id
1367 12a213df6fa9 tip
1367 12a213df6fa9 tip
1368 $ hg -R t id
1368 $ hg -R t id
1369 52c0adc0515a tip
1369 52c0adc0515a tip
1370 $ cd s
1370 $ cd s
1371 $ hg update -r -2
1371 $ hg update -r -2
1372 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1372 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1373 $ cd ../t
1373 $ cd ../t
1374 $ hg update -r 2
1374 $ hg update -r 2
1375 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1375 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1376 $ cd ..
1376 $ cd ..
1377 $ hg update 10
1377 $ hg update 10
1378 subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
1378 subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
1379 you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination].
1379 you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination].
1380 what do you want to do? m
1380 what do you want to do? m
1381 subrepository t diverged (local revision: 52c0adc0515a, remote revision: 20a0db6fbf6c)
1381 subrepository t diverged (local revision: 52c0adc0515a, remote revision: 20a0db6fbf6c)
1382 you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination].
1382 you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination].
1383 what do you want to do? m
1383 what do you want to do? m
1384 subrepository sources for t differ (in checked out version)
1384 subrepository sources for t differ (in checked out version)
1385 you can use (l)ocal source (7af322bc1198) or (r)emote source (20a0db6fbf6c).
1385 you can use (l)ocal source (7af322bc1198) or (r)emote source (20a0db6fbf6c).
1386 what do you want to do? l
1386 what do you want to do? l
1387 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1387 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1388 $ hg id
1388 $ hg id
1389 e45c8b14af55+
1389 e45c8b14af55+
1390 $ hg -R s id
1390 $ hg -R s id
1391 02dcf1d70411
1391 02dcf1d70411
1392 $ hg -R t id
1392 $ hg -R t id
1393 7af322bc1198
1393 7af322bc1198
1394
1394
1395 Sticky subrepository, file changes and revision updates
1395 Sticky subrepository, file changes and revision updates
1396 $ touch s/f1
1396 $ touch s/f1
1397 $ touch t/f1
1397 $ touch t/f1
1398 $ hg add -S s/f1
1398 $ hg add -S s/f1
1399 $ hg add -S t/f1
1399 $ hg add -S t/f1
1400 $ hg id
1400 $ hg id
1401 e45c8b14af55+
1401 e45c8b14af55+
1402 $ hg -R s id
1402 $ hg -R s id
1403 02dcf1d70411+
1403 02dcf1d70411+
1404 $ hg -R t id
1404 $ hg -R t id
1405 7af322bc1198+
1405 7af322bc1198+
1406 $ hg update tip
1406 $ hg update tip
1407 subrepository s diverged (local revision: 12a213df6fa9, remote revision: 12a213df6fa9)
1407 subrepository s diverged (local revision: 12a213df6fa9, remote revision: 12a213df6fa9)
1408 you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination].
1408 you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination].
1409 what do you want to do? m
1409 what do you want to do? m
1410 subrepository sources for s differ
1410 subrepository sources for s differ
1411 you can use (l)ocal source (02dcf1d70411) or (r)emote source (12a213df6fa9).
1411 you can use (l)ocal source (02dcf1d70411) or (r)emote source (12a213df6fa9).
1412 what do you want to do? l
1412 what do you want to do? l
1413 subrepository t diverged (local revision: 52c0adc0515a, remote revision: 52c0adc0515a)
1413 subrepository t diverged (local revision: 52c0adc0515a, remote revision: 52c0adc0515a)
1414 you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination].
1414 you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination].
1415 what do you want to do? m
1415 what do you want to do? m
1416 subrepository sources for t differ
1416 subrepository sources for t differ
1417 you can use (l)ocal source (7af322bc1198) or (r)emote source (52c0adc0515a).
1417 you can use (l)ocal source (7af322bc1198) or (r)emote source (52c0adc0515a).
1418 what do you want to do? l
1418 what do you want to do? l
1419 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1419 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1420 $ hg id
1420 $ hg id
1421 925c17564ef8+ tip
1421 925c17564ef8+ tip
1422 $ hg -R s id
1422 $ hg -R s id
1423 02dcf1d70411+
1423 02dcf1d70411+
1424 $ hg -R t id
1424 $ hg -R t id
1425 7af322bc1198+
1425 7af322bc1198+
1426
1426
1427 Sticky repository, update --clean
1427 Sticky repository, update --clean
1428 $ hg update --clean tip
1428 $ hg update --clean tip
1429 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1429 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1430 $ hg id
1430 $ hg id
1431 925c17564ef8 tip
1431 925c17564ef8 tip
1432 $ hg -R s id
1432 $ hg -R s id
1433 12a213df6fa9 tip
1433 12a213df6fa9 tip
1434 $ hg -R t id
1434 $ hg -R t id
1435 52c0adc0515a tip
1435 52c0adc0515a tip
1436
1436
1437 Test subrepo already at intended revision:
1437 Test subrepo already at intended revision:
1438 $ cd s
1438 $ cd s
1439 $ hg update fc627a69481f
1439 $ hg update fc627a69481f
1440 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1440 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1441 $ cd ..
1441 $ cd ..
1442 $ hg update 11
1442 $ hg update 11
1443 subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
1443 subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
1444 you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination].
1444 you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination].
1445 what do you want to do? m
1445 what do you want to do? m
1446 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1446 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1447 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1447 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1448 $ hg id -n
1448 $ hg id -n
1449 11+
1449 11+
1450 $ hg -R s id
1450 $ hg -R s id
1451 fc627a69481f
1451 fc627a69481f
1452 $ hg -R t id
1452 $ hg -R t id
1453 e95bcfa18a35
1453 e95bcfa18a35
1454
1454
1455 Test that removing .hgsubstate doesn't break anything:
1455 Test that removing .hgsubstate doesn't break anything:
1456
1456
1457 $ hg rm -f .hgsubstate
1457 $ hg rm -f .hgsubstate
1458 $ hg ci -mrm
1458 $ hg ci -mrm
1459 nothing changed
1459 nothing changed
1460 [1]
1460 [1]
1461 $ hg log -vr tip
1461 $ hg log -vr tip
1462 changeset: 13:925c17564ef8
1462 changeset: 13:925c17564ef8
1463 tag: tip
1463 tag: tip
1464 user: test
1464 user: test
1465 date: Thu Jan 01 00:00:00 1970 +0000
1465 date: Thu Jan 01 00:00:00 1970 +0000
1466 files: .hgsubstate
1466 files: .hgsubstate
1467 description:
1467 description:
1468 13
1468 13
1469
1469
1470
1470
1471
1471
1472 Test that removing .hgsub removes .hgsubstate:
1472 Test that removing .hgsub removes .hgsubstate:
1473
1473
1474 $ hg rm .hgsub
1474 $ hg rm .hgsub
1475 $ hg ci -mrm2
1475 $ hg ci -mrm2
1476 created new head
1476 created new head
1477 $ hg log -vr tip
1477 $ hg log -vr tip
1478 changeset: 14:2400bccd50af
1478 changeset: 14:2400bccd50af
1479 tag: tip
1479 tag: tip
1480 parent: 11:365661e5936a
1480 parent: 11:365661e5936a
1481 user: test
1481 user: test
1482 date: Thu Jan 01 00:00:00 1970 +0000
1482 date: Thu Jan 01 00:00:00 1970 +0000
1483 files: .hgsub .hgsubstate
1483 files: .hgsub .hgsubstate
1484 description:
1484 description:
1485 rm2
1485 rm2
1486
1486
1487
1487
1488 Test issue3153: diff -S with deleted subrepos
1488 Test issue3153: diff -S with deleted subrepos
1489
1489
1490 $ hg diff --nodates -S -c .
1490 $ hg diff --nodates -S -c .
1491 diff -r 365661e5936a -r 2400bccd50af .hgsub
1491 diff -r 365661e5936a -r 2400bccd50af .hgsub
1492 --- a/.hgsub
1492 --- a/.hgsub
1493 +++ /dev/null
1493 +++ /dev/null
1494 @@ -1,2 +0,0 @@
1494 @@ -1,2 +0,0 @@
1495 -s = s
1495 -s = s
1496 -t = t
1496 -t = t
1497 diff -r 365661e5936a -r 2400bccd50af .hgsubstate
1497 diff -r 365661e5936a -r 2400bccd50af .hgsubstate
1498 --- a/.hgsubstate
1498 --- a/.hgsubstate
1499 +++ /dev/null
1499 +++ /dev/null
1500 @@ -1,2 +0,0 @@
1500 @@ -1,2 +0,0 @@
1501 -fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
1501 -fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
1502 -e95bcfa18a358dc4936da981ebf4147b4cad1362 t
1502 -e95bcfa18a358dc4936da981ebf4147b4cad1362 t
1503
1503
1504 Test behavior of add for explicit path in subrepo:
1504 Test behavior of add for explicit path in subrepo:
1505 $ cd ..
1505 $ cd ..
1506 $ hg init explicit
1506 $ hg init explicit
1507 $ cd explicit
1507 $ cd explicit
1508 $ echo s = s > .hgsub
1508 $ echo s = s > .hgsub
1509 $ hg add .hgsub
1509 $ hg add .hgsub
1510 $ hg init s
1510 $ hg init s
1511 $ hg ci -m0
1511 $ hg ci -m0
1512 Adding with an explicit path in a subrepo adds the file
1512 Adding with an explicit path in a subrepo adds the file
1513 $ echo c1 > f1
1513 $ echo c1 > f1
1514 $ echo c2 > s/f2
1514 $ echo c2 > s/f2
1515 $ hg st -S
1515 $ hg st -S
1516 ? f1
1516 ? f1
1517 ? s/f2
1517 ? s/f2
1518 $ hg add s/f2
1518 $ hg add s/f2
1519 $ hg st -S
1519 $ hg st -S
1520 A s/f2
1520 A s/f2
1521 ? f1
1521 ? f1
1522 $ hg ci -R s -m0
1522 $ hg ci -R s -m0
1523 $ hg ci -Am1
1523 $ hg ci -Am1
1524 adding f1
1524 adding f1
1525 Adding with an explicit path in a subrepo with -S has the same behavior
1525 Adding with an explicit path in a subrepo with -S has the same behavior
1526 $ echo c3 > f3
1526 $ echo c3 > f3
1527 $ echo c4 > s/f4
1527 $ echo c4 > s/f4
1528 $ hg st -S
1528 $ hg st -S
1529 ? f3
1529 ? f3
1530 ? s/f4
1530 ? s/f4
1531 $ hg add -S s/f4
1531 $ hg add -S s/f4
1532 $ hg st -S
1532 $ hg st -S
1533 A s/f4
1533 A s/f4
1534 ? f3
1534 ? f3
1535 $ hg ci -R s -m1
1535 $ hg ci -R s -m1
1536 $ hg ci -Ama2
1536 $ hg ci -Ama2
1537 adding f3
1537 adding f3
1538 Adding without a path or pattern silently ignores subrepos
1538 Adding without a path or pattern silently ignores subrepos
1539 $ echo c5 > f5
1539 $ echo c5 > f5
1540 $ echo c6 > s/f6
1540 $ echo c6 > s/f6
1541 $ echo c7 > s/f7
1541 $ echo c7 > s/f7
1542 $ hg st -S
1542 $ hg st -S
1543 ? f5
1543 ? f5
1544 ? s/f6
1544 ? s/f6
1545 ? s/f7
1545 ? s/f7
1546 $ hg add
1546 $ hg add
1547 adding f5
1547 adding f5
1548 $ hg st -S
1548 $ hg st -S
1549 A f5
1549 A f5
1550 ? s/f6
1550 ? s/f6
1551 ? s/f7
1551 ? s/f7
1552 $ hg ci -R s -Am2
1552 $ hg ci -R s -Am2
1553 adding f6
1553 adding f6
1554 adding f7
1554 adding f7
1555 $ hg ci -m3
1555 $ hg ci -m3
1556 Adding without a path or pattern with -S also adds files in subrepos
1556 Adding without a path or pattern with -S also adds files in subrepos
1557 $ echo c8 > f8
1557 $ echo c8 > f8
1558 $ echo c9 > s/f9
1558 $ echo c9 > s/f9
1559 $ echo c10 > s/f10
1559 $ echo c10 > s/f10
1560 $ hg st -S
1560 $ hg st -S
1561 ? f8
1561 ? f8
1562 ? s/f10
1562 ? s/f10
1563 ? s/f9
1563 ? s/f9
1564 $ hg add -S
1564 $ hg add -S
1565 adding f8
1565 adding f8
1566 adding s/f10
1566 adding s/f10
1567 adding s/f9
1567 adding s/f9
1568 $ hg st -S
1568 $ hg st -S
1569 A f8
1569 A f8
1570 A s/f10
1570 A s/f10
1571 A s/f9
1571 A s/f9
1572 $ hg ci -R s -m3
1572 $ hg ci -R s -m3
1573 $ hg ci -m4
1573 $ hg ci -m4
1574 Adding with a pattern silently ignores subrepos
1574 Adding with a pattern silently ignores subrepos
1575 $ echo c11 > fm11
1575 $ echo c11 > fm11
1576 $ echo c12 > fn12
1576 $ echo c12 > fn12
1577 $ echo c13 > s/fm13
1577 $ echo c13 > s/fm13
1578 $ echo c14 > s/fn14
1578 $ echo c14 > s/fn14
1579 $ hg st -S
1579 $ hg st -S
1580 ? fm11
1580 ? fm11
1581 ? fn12
1581 ? fn12
1582 ? s/fm13
1582 ? s/fm13
1583 ? s/fn14
1583 ? s/fn14
1584 $ hg add 'glob:**fm*'
1584 $ hg add 'glob:**fm*'
1585 adding fm11
1585 adding fm11
1586 $ hg st -S
1586 $ hg st -S
1587 A fm11
1587 A fm11
1588 ? fn12
1588 ? fn12
1589 ? s/fm13
1589 ? s/fm13
1590 ? s/fn14
1590 ? s/fn14
1591 $ hg ci -R s -Am4
1591 $ hg ci -R s -Am4
1592 adding fm13
1592 adding fm13
1593 adding fn14
1593 adding fn14
1594 $ hg ci -Am5
1594 $ hg ci -Am5
1595 adding fn12
1595 adding fn12
1596 Adding with a pattern with -S also adds matches in subrepos
1596 Adding with a pattern with -S also adds matches in subrepos
1597 $ echo c15 > fm15
1597 $ echo c15 > fm15
1598 $ echo c16 > fn16
1598 $ echo c16 > fn16
1599 $ echo c17 > s/fm17
1599 $ echo c17 > s/fm17
1600 $ echo c18 > s/fn18
1600 $ echo c18 > s/fn18
1601 $ hg st -S
1601 $ hg st -S
1602 ? fm15
1602 ? fm15
1603 ? fn16
1603 ? fn16
1604 ? s/fm17
1604 ? s/fm17
1605 ? s/fn18
1605 ? s/fn18
1606 $ hg add -S 'glob:**fm*'
1606 $ hg add -S 'glob:**fm*'
1607 adding fm15
1607 adding fm15
1608 adding s/fm17
1608 adding s/fm17
1609 $ hg st -S
1609 $ hg st -S
1610 A fm15
1610 A fm15
1611 A s/fm17
1611 A s/fm17
1612 ? fn16
1612 ? fn16
1613 ? s/fn18
1613 ? s/fn18
1614 $ hg ci -R s -Am5
1614 $ hg ci -R s -Am5
1615 adding fn18
1615 adding fn18
1616 $ hg ci -Am6
1616 $ hg ci -Am6
1617 adding fn16
1617 adding fn16
1618
1618
1619 Test behavior of forget for explicit path in subrepo:
1619 Test behavior of forget for explicit path in subrepo:
1620 Forgetting an explicit path in a subrepo untracks the file
1620 Forgetting an explicit path in a subrepo untracks the file
1621 $ echo c19 > s/f19
1621 $ echo c19 > s/f19
1622 $ hg add s/f19
1622 $ hg add s/f19
1623 $ hg st -S
1623 $ hg st -S
1624 A s/f19
1624 A s/f19
1625 $ hg forget s/f19
1625 $ hg forget s/f19
1626 $ hg st -S
1626 $ hg st -S
1627 ? s/f19
1627 ? s/f19
1628 $ rm s/f19
1628 $ rm s/f19
1629 $ cd ..
1629 $ cd ..
1630
1630
1631 Courtesy phases synchronisation to publishing server does not block the push
1631 Courtesy phases synchronisation to publishing server does not block the push
1632 (issue3781)
1632 (issue3781)
1633
1633
1634 $ cp -R main issue3781
1634 $ cp -R main issue3781
1635 $ cp -R main issue3781-dest
1635 $ cp -R main issue3781-dest
1636 $ cd issue3781-dest/s
1636 $ cd issue3781-dest/s
1637 $ hg phase tip # show we have draft changeset
1637 $ hg phase tip # show we have draft changeset
1638 5: draft
1638 5: draft
1639 $ chmod a-w .hg/store/phaseroots # prevent phase push
1639 $ chmod a-w .hg/store/phaseroots # prevent phase push
1640 $ cd ../../issue3781
1640 $ cd ../../issue3781
1641 $ cat >> .hg/hgrc << EOF
1641 $ cat >> .hg/hgrc << EOF
1642 > [paths]
1642 > [paths]
1643 > default=../issue3781-dest/
1643 > default=../issue3781-dest/
1644 > EOF
1644 > EOF
1645 $ hg push --config devel.legacy.exchange=bundle1
1645 $ hg push --config devel.legacy.exchange=bundle1
1646 pushing to $TESTTMP/issue3781-dest
1646 pushing to $TESTTMP/issue3781-dest
1647 pushing subrepo s to $TESTTMP/issue3781-dest/s
1647 pushing subrepo s to $TESTTMP/issue3781-dest/s
1648 searching for changes
1648 searching for changes
1649 no changes found
1649 no changes found
1650 searching for changes
1650 searching for changes
1651 no changes found
1651 no changes found
1652 [1]
1652 [1]
1653 # clean the push cache
1653 # clean the push cache
1654 $ rm s/.hg/cache/storehash/*
1654 $ rm s/.hg/cache/storehash/*
1655 $ hg push # bundle2+
1655 $ hg push # bundle2+
1656 pushing to $TESTTMP/issue3781-dest
1656 pushing to $TESTTMP/issue3781-dest
1657 pushing subrepo s to $TESTTMP/issue3781-dest/s
1657 pushing subrepo s to $TESTTMP/issue3781-dest/s
1658 searching for changes
1658 searching for changes
1659 no changes found
1659 no changes found
1660 searching for changes
1660 searching for changes
1661 no changes found
1661 no changes found
1662 [1]
1662 [1]
1663 $ cd ..
1663 $ cd ..
1664
1664
1665 Test phase choice for newly created commit with "phases.subrepochecks"
1665 Test phase choice for newly created commit with "phases.subrepochecks"
1666 configuration
1666 configuration
1667
1667
1668 $ cd t
1668 $ cd t
1669 $ hg update -q -r 12
1669 $ hg update -q -r 12
1670
1670
1671 $ cat >> s/ss/.hg/hgrc <<EOF
1671 $ cat >> s/ss/.hg/hgrc <<EOF
1672 > [phases]
1672 > [phases]
1673 > new-commit = secret
1673 > new-commit = secret
1674 > EOF
1674 > EOF
1675 $ cat >> s/.hg/hgrc <<EOF
1675 $ cat >> s/.hg/hgrc <<EOF
1676 > [phases]
1676 > [phases]
1677 > new-commit = draft
1677 > new-commit = draft
1678 > EOF
1678 > EOF
1679 $ echo phasecheck1 >> s/ss/a
1679 $ echo phasecheck1 >> s/ss/a
1680 $ hg -R s commit -S --config phases.checksubrepos=abort -m phasecheck1
1680 $ hg -R s commit -S --config phases.checksubrepos=abort -m phasecheck1
1681 committing subrepository ss
1681 committing subrepository ss
1682 transaction abort!
1682 transaction abort!
1683 rollback completed
1683 rollback completed
1684 abort: can't commit in draft phase conflicting secret from subrepository ss
1684 abort: can't commit in draft phase conflicting secret from subrepository ss
1685 [255]
1685 [255]
1686 $ echo phasecheck2 >> s/ss/a
1686 $ echo phasecheck2 >> s/ss/a
1687 $ hg -R s commit -S --config phases.checksubrepos=ignore -m phasecheck2
1687 $ hg -R s commit -S --config phases.checksubrepos=ignore -m phasecheck2
1688 committing subrepository ss
1688 committing subrepository ss
1689 $ hg -R s/ss phase tip
1689 $ hg -R s/ss phase tip
1690 3: secret
1690 3: secret
1691 $ hg -R s phase tip
1691 $ hg -R s phase tip
1692 6: draft
1692 6: draft
1693 $ echo phasecheck3 >> s/ss/a
1693 $ echo phasecheck3 >> s/ss/a
1694 $ hg -R s commit -S -m phasecheck3
1694 $ hg -R s commit -S -m phasecheck3
1695 committing subrepository ss
1695 committing subrepository ss
1696 warning: changes are committed in secret phase from subrepository ss
1696 warning: changes are committed in secret phase from subrepository ss
1697 $ hg -R s/ss phase tip
1697 $ hg -R s/ss phase tip
1698 4: secret
1698 4: secret
1699 $ hg -R s phase tip
1699 $ hg -R s phase tip
1700 7: secret
1700 7: secret
1701
1701
1702 $ cat >> t/.hg/hgrc <<EOF
1702 $ cat >> t/.hg/hgrc <<EOF
1703 > [phases]
1703 > [phases]
1704 > new-commit = draft
1704 > new-commit = draft
1705 > EOF
1705 > EOF
1706 $ cat >> .hg/hgrc <<EOF
1706 $ cat >> .hg/hgrc <<EOF
1707 > [phases]
1707 > [phases]
1708 > new-commit = public
1708 > new-commit = public
1709 > EOF
1709 > EOF
1710 $ echo phasecheck4 >> s/ss/a
1710 $ echo phasecheck4 >> s/ss/a
1711 $ echo phasecheck4 >> t/t
1711 $ echo phasecheck4 >> t/t
1712 $ hg commit -S -m phasecheck4
1712 $ hg commit -S -m phasecheck4
1713 committing subrepository s
1713 committing subrepository s
1714 committing subrepository s/ss
1714 committing subrepository s/ss
1715 warning: changes are committed in secret phase from subrepository ss
1715 warning: changes are committed in secret phase from subrepository ss
1716 committing subrepository t
1716 committing subrepository t
1717 warning: changes are committed in secret phase from subrepository s
1717 warning: changes are committed in secret phase from subrepository s
1718 created new head
1718 created new head
1719 $ hg -R s/ss phase tip
1719 $ hg -R s/ss phase tip
1720 5: secret
1720 5: secret
1721 $ hg -R s phase tip
1721 $ hg -R s phase tip
1722 8: secret
1722 8: secret
1723 $ hg -R t phase tip
1723 $ hg -R t phase tip
1724 6: draft
1724 6: draft
1725 $ hg phase tip
1725 $ hg phase tip
1726 15: secret
1726 15: secret
1727
1727
1728 $ cd ..
1728 $ cd ..
1729
1729
1730
1730
1731 Test that commit --secret works on both repo and subrepo (issue4182)
1731 Test that commit --secret works on both repo and subrepo (issue4182)
1732
1732
1733 $ cd main
1733 $ cd main
1734 $ echo secret >> b
1734 $ echo secret >> b
1735 $ echo secret >> s/b
1735 $ echo secret >> s/b
1736 $ hg commit --secret --subrepo -m "secret"
1736 $ hg commit --secret --subrepo -m "secret"
1737 committing subrepository s
1737 committing subrepository s
1738 $ hg phase -r .
1738 $ hg phase -r .
1739 6: secret
1739 6: secret
1740 $ cd s
1740 $ cd s
1741 $ hg phase -r .
1741 $ hg phase -r .
1742 6: secret
1742 6: secret
1743 $ cd ../../
1743 $ cd ../../
1744
1744
1745 Test "subrepos" template keyword
1745 Test "subrepos" template keyword
1746
1746
1747 $ cd t
1747 $ cd t
1748 $ hg update -q 15
1748 $ hg update -q 15
1749 $ cat > .hgsub <<EOF
1749 $ cat > .hgsub <<EOF
1750 > s = s
1750 > s = s
1751 > EOF
1751 > EOF
1752 $ hg commit -m "16"
1752 $ hg commit -m "16"
1753 warning: changes are committed in secret phase from subrepository s
1753 warning: changes are committed in secret phase from subrepository s
1754
1754
1755 (addition of ".hgsub" itself)
1755 (addition of ".hgsub" itself)
1756
1756
1757 $ hg diff --nodates -c 1 .hgsubstate
1757 $ hg diff --nodates -c 1 .hgsubstate
1758 diff -r f7b1eb17ad24 -r 7cf8cfea66e4 .hgsubstate
1758 diff -r f7b1eb17ad24 -r 7cf8cfea66e4 .hgsubstate
1759 --- /dev/null
1759 --- /dev/null
1760 +++ b/.hgsubstate
1760 +++ b/.hgsubstate
1761 @@ -0,0 +1,1 @@
1761 @@ -0,0 +1,1 @@
1762 +e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1762 +e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1763 $ hg log -r 1 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1763 $ hg log -r 1 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1764 f7b1eb17ad24 000000000000
1764 f7b1eb17ad24 000000000000
1765 s
1765 s
1766
1766
1767 (modification of existing entry)
1767 (modification of existing entry)
1768
1768
1769 $ hg diff --nodates -c 2 .hgsubstate
1769 $ hg diff --nodates -c 2 .hgsubstate
1770 diff -r 7cf8cfea66e4 -r df30734270ae .hgsubstate
1770 diff -r 7cf8cfea66e4 -r df30734270ae .hgsubstate
1771 --- a/.hgsubstate
1771 --- a/.hgsubstate
1772 +++ b/.hgsubstate
1772 +++ b/.hgsubstate
1773 @@ -1,1 +1,1 @@
1773 @@ -1,1 +1,1 @@
1774 -e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1774 -e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1775 +dc73e2e6d2675eb2e41e33c205f4bdab4ea5111d s
1775 +dc73e2e6d2675eb2e41e33c205f4bdab4ea5111d s
1776 $ hg log -r 2 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1776 $ hg log -r 2 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1777 7cf8cfea66e4 000000000000
1777 7cf8cfea66e4 000000000000
1778 s
1778 s
1779
1779
1780 (addition of entry)
1780 (addition of entry)
1781
1781
1782 $ hg diff --nodates -c 5 .hgsubstate
1782 $ hg diff --nodates -c 5 .hgsubstate
1783 diff -r 7cf8cfea66e4 -r 1f14a2e2d3ec .hgsubstate
1783 diff -r 7cf8cfea66e4 -r 1f14a2e2d3ec .hgsubstate
1784 --- a/.hgsubstate
1784 --- a/.hgsubstate
1785 +++ b/.hgsubstate
1785 +++ b/.hgsubstate
1786 @@ -1,1 +1,2 @@
1786 @@ -1,1 +1,2 @@
1787 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1787 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1788 +60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t
1788 +60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t
1789 $ hg log -r 5 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1789 $ hg log -r 5 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1790 7cf8cfea66e4 000000000000
1790 7cf8cfea66e4 000000000000
1791 t
1791 t
1792
1792
1793 (removal of existing entry)
1793 (removal of existing entry)
1794
1794
1795 $ hg diff --nodates -c 16 .hgsubstate
1795 $ hg diff --nodates -c 16 .hgsubstate
1796 diff -r 8bec38d2bd0b -r f2f70bc3d3c9 .hgsubstate
1796 diff -r 8bec38d2bd0b -r f2f70bc3d3c9 .hgsubstate
1797 --- a/.hgsubstate
1797 --- a/.hgsubstate
1798 +++ b/.hgsubstate
1798 +++ b/.hgsubstate
1799 @@ -1,2 +1,1 @@
1799 @@ -1,2 +1,1 @@
1800 0731af8ca9423976d3743119d0865097c07bdc1b s
1800 0731af8ca9423976d3743119d0865097c07bdc1b s
1801 -e202dc79b04c88a636ea8913d9182a1346d9b3dc t
1801 -e202dc79b04c88a636ea8913d9182a1346d9b3dc t
1802 $ hg log -r 16 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1802 $ hg log -r 16 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1803 8bec38d2bd0b 000000000000
1803 8bec38d2bd0b 000000000000
1804 t
1804 t
1805
1805
1806 (merging)
1806 (merging)
1807
1807
1808 $ hg diff --nodates -c 9 .hgsubstate
1808 $ hg diff --nodates -c 9 .hgsubstate
1809 diff -r f6affe3fbfaa -r f0d2028bf86d .hgsubstate
1809 diff -r f6affe3fbfaa -r f0d2028bf86d .hgsubstate
1810 --- a/.hgsubstate
1810 --- a/.hgsubstate
1811 +++ b/.hgsubstate
1811 +++ b/.hgsubstate
1812 @@ -1,1 +1,2 @@
1812 @@ -1,1 +1,2 @@
1813 fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
1813 fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
1814 +60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t
1814 +60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t
1815 $ hg log -r 9 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1815 $ hg log -r 9 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1816 f6affe3fbfaa 1f14a2e2d3ec
1816 f6affe3fbfaa 1f14a2e2d3ec
1817 t
1817 t
1818
1818
1819 (removal of ".hgsub" itself)
1819 (removal of ".hgsub" itself)
1820
1820
1821 $ hg diff --nodates -c 8 .hgsubstate
1821 $ hg diff --nodates -c 8 .hgsubstate
1822 diff -r f94576341bcf -r 96615c1dad2d .hgsubstate
1822 diff -r f94576341bcf -r 96615c1dad2d .hgsubstate
1823 --- a/.hgsubstate
1823 --- a/.hgsubstate
1824 +++ /dev/null
1824 +++ /dev/null
1825 @@ -1,2 +0,0 @@
1825 @@ -1,2 +0,0 @@
1826 -e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1826 -e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1827 -7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4 t
1827 -7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4 t
1828 $ hg log -r 8 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1828 $ hg log -r 8 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1829 f94576341bcf 000000000000
1829 f94576341bcf 000000000000
1830
1830
1831 Test that '[paths]' is configured correctly at subrepo creation
1831 Test that '[paths]' is configured correctly at subrepo creation
1832
1832
1833 $ cd $TESTTMP/tc
1833 $ cd $TESTTMP/tc
1834 $ cat > .hgsub <<EOF
1834 $ cat > .hgsub <<EOF
1835 > # to clear bogus subrepo path 'bogus=[boguspath'
1835 > # to clear bogus subrepo path 'bogus=[boguspath'
1836 > s = s
1836 > s = s
1837 > t = t
1837 > t = t
1838 > EOF
1838 > EOF
1839 $ hg update -q --clean null
1839 $ hg update -q --clean null
1840 $ rm -rf s t
1840 $ rm -rf s t
1841 $ cat >> .hg/hgrc <<EOF
1841 $ cat >> .hg/hgrc <<EOF
1842 > [paths]
1842 > [paths]
1843 > default-push = /foo/bar
1843 > default-push = /foo/bar
1844 > EOF
1844 > EOF
1845 $ hg update -q
1845 $ hg update -q
1846 $ cat s/.hg/hgrc
1846 $ cat s/.hg/hgrc
1847 [paths]
1847 [paths]
1848 default = $TESTTMP/t/s
1848 default = $TESTTMP/t/s
1849 default-push = /foo/bar/s
1849 default-push = /foo/bar/s
1850 $ cat s/ss/.hg/hgrc
1850 $ cat s/ss/.hg/hgrc
1851 [paths]
1851 [paths]
1852 default = $TESTTMP/t/s/ss
1852 default = $TESTTMP/t/s/ss
1853 default-push = /foo/bar/s/ss
1853 default-push = /foo/bar/s/ss
1854 $ cat t/.hg/hgrc
1854 $ cat t/.hg/hgrc
1855 [paths]
1855 [paths]
1856 default = $TESTTMP/t/t
1856 default = $TESTTMP/t/t
1857 default-push = /foo/bar/t
1857 default-push = /foo/bar/t
1858
1858
1859 $ cd $TESTTMP/t
1859 $ cd $TESTTMP/t
1860 $ hg up -qC 0
1860 $ hg up -qC 0
1861 $ echo 'bar' > bar.txt
1861 $ echo 'bar' > bar.txt
1862 $ hg ci -Am 'branch before subrepo add'
1862 $ hg ci -Am 'branch before subrepo add'
1863 adding bar.txt
1863 adding bar.txt
1864 created new head
1864 created new head
1865 $ hg merge -r "first(subrepo('s'))"
1865 $ hg merge -r "first(subrepo('s'))"
1866 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1866 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1867 (branch merge, don't forget to commit)
1867 (branch merge, don't forget to commit)
1868 $ hg status -S -X '.hgsub*'
1868 $ hg status -S -X '.hgsub*'
1869 A s/a
1869 A s/a
1870 ? s/b
1870 ? s/b
1871 ? s/c
1871 ? s/c
1872 ? s/f1
1872 ? s/f1
1873 $ hg status -S --rev 'p2()'
1873 $ hg status -S --rev 'p2()'
1874 A bar.txt
1874 A bar.txt
1875 ? s/b
1875 ? s/b
1876 ? s/c
1876 ? s/c
1877 ? s/f1
1877 ? s/f1
1878 $ hg diff -S -X '.hgsub*' --nodates
1878 $ hg diff -S -X '.hgsub*' --nodates
1879 diff -r 000000000000 s/a
1879 diff -r 000000000000 s/a
1880 --- /dev/null
1880 --- /dev/null
1881 +++ b/s/a
1881 +++ b/s/a
1882 @@ -0,0 +1,1 @@
1882 @@ -0,0 +1,1 @@
1883 +a
1883 +a
1884 $ hg diff -S --rev 'p2()' --nodates
1884 $ hg diff -S --rev 'p2()' --nodates
1885 diff -r 7cf8cfea66e4 bar.txt
1885 diff -r 7cf8cfea66e4 bar.txt
1886 --- /dev/null
1886 --- /dev/null
1887 +++ b/bar.txt
1887 +++ b/bar.txt
1888 @@ -0,0 +1,1 @@
1888 @@ -0,0 +1,1 @@
1889 +bar
1889 +bar
1890
1890
1891 $ hg diff -X '.hgsub*' --nodates s
1891 $ hg diff -X '.hgsub*' --nodates s
1892 diff -r 000000000000 s/a
1892 diff -r 000000000000 s/a
1893 --- /dev/null
1893 --- /dev/null
1894 +++ b/s/a
1894 +++ b/s/a
1895 @@ -0,0 +1,1 @@
1895 @@ -0,0 +1,1 @@
1896 +a
1896 +a
1897 $ hg diff -X '.hgsub*' --nodates s/a
1897 $ hg diff -X '.hgsub*' --nodates s/a
1898 diff -r 000000000000 s/a
1898 diff -r 000000000000 s/a
1899 --- /dev/null
1899 --- /dev/null
1900 +++ b/s/a
1900 +++ b/s/a
1901 @@ -0,0 +1,1 @@
1901 @@ -0,0 +1,1 @@
1902 +a
1902 +a
1903
1903
1904 $ cd ..
1904 $ cd ..
1905
1905
1906 test for ssh exploit 2017-07-25
1906 test for ssh exploit 2017-07-25
1907
1907
1908 $ cat >> $HGRCPATH << EOF
1908 $ cat >> $HGRCPATH << EOF
1909 > [ui]
1909 > [ui]
1910 > ssh = sh -c "read l; read l; read l"
1910 > ssh = sh -c "read l; read l; read l"
1911 > EOF
1911 > EOF
1912
1912
1913 $ hg init malicious-proxycommand
1913 $ hg init malicious-proxycommand
1914 $ cd malicious-proxycommand
1914 $ cd malicious-proxycommand
1915 $ echo 's = [hg]ssh://-oProxyCommand=touch${IFS}owned/path' > .hgsub
1915 $ echo 's = [hg]ssh://-oProxyCommand=touch${IFS}owned/path' > .hgsub
1916 $ hg init s
1916 $ hg init s
1917 $ cd s
1917 $ cd s
1918 $ echo init > init
1918 $ echo init > init
1919 $ hg add
1919 $ hg add
1920 adding init
1920 adding init
1921 $ hg commit -m init
1921 $ hg commit -m init
1922 $ cd ..
1922 $ cd ..
1923 $ hg add .hgsub
1923 $ hg add .hgsub
1924 $ hg ci -m 'add subrepo'
1924 $ hg ci -m 'add subrepo'
1925 $ cd ..
1925 $ cd ..
1926 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1926 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1927 updating to branch default
1927 updating to branch default
1928 cloning subrepo s from ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path
1928 cloning subrepo s from ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path
1929 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' (in subrepository "s")
1929 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' (in subrepository "s")
1930 [255]
1930 [255]
1931
1931
1932 also check that a percent encoded '-' (%2D) doesn't work
1932 also check that a percent encoded '-' (%2D) doesn't work
1933
1933
1934 $ cd malicious-proxycommand
1934 $ cd malicious-proxycommand
1935 $ echo 's = [hg]ssh://%2DoProxyCommand=touch${IFS}owned/path' > .hgsub
1935 $ echo 's = [hg]ssh://%2DoProxyCommand=touch${IFS}owned/path' > .hgsub
1936 $ hg ci -m 'change url to percent encoded'
1936 $ hg ci -m 'change url to percent encoded'
1937 $ cd ..
1937 $ cd ..
1938 $ rm -r malicious-proxycommand-clone
1938 $ rm -r malicious-proxycommand-clone
1939 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1939 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1940 updating to branch default
1940 updating to branch default
1941 cloning subrepo s from ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path
1941 cloning subrepo s from ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path
1942 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' (in subrepository "s")
1942 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' (in subrepository "s")
1943 [255]
1943 [255]
1944
1944
1945 also check for a pipe
1945 also check for a pipe
1946
1946
1947 $ cd malicious-proxycommand
1947 $ cd malicious-proxycommand
1948 $ echo 's = [hg]ssh://fakehost|touch${IFS}owned/path' > .hgsub
1948 $ echo 's = [hg]ssh://fakehost|touch${IFS}owned/path' > .hgsub
1949 $ hg ci -m 'change url to pipe'
1949 $ hg ci -m 'change url to pipe'
1950 $ cd ..
1950 $ cd ..
1951 $ rm -r malicious-proxycommand-clone
1951 $ rm -r malicious-proxycommand-clone
1952 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1952 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1953 updating to branch default
1953 updating to branch default
1954 cloning subrepo s from ssh://fakehost%7Ctouch%24%7BIFS%7Downed/path
1954 cloning subrepo s from ssh://fakehost%7Ctouch%24%7BIFS%7Downed/path
1955 abort: no suitable response from remote hg!
1955 abort: no suitable response from remote hg!
1956 [255]
1956 [255]
1957 $ [ ! -f owned ] || echo 'you got owned'
1957 $ [ ! -f owned ] || echo 'you got owned'
1958
1958
1959 also check that a percent encoded '|' (%7C) doesn't work
1959 also check that a percent encoded '|' (%7C) doesn't work
1960
1960
1961 $ cd malicious-proxycommand
1961 $ cd malicious-proxycommand
1962 $ echo 's = [hg]ssh://fakehost%7Ctouch%20owned/path' > .hgsub
1962 $ echo 's = [hg]ssh://fakehost%7Ctouch%20owned/path' > .hgsub
1963 $ hg ci -m 'change url to percent encoded pipe'
1963 $ hg ci -m 'change url to percent encoded pipe'
1964 $ cd ..
1964 $ cd ..
1965 $ rm -r malicious-proxycommand-clone
1965 $ rm -r malicious-proxycommand-clone
1966 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1966 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1967 updating to branch default
1967 updating to branch default
1968 cloning subrepo s from ssh://fakehost%7Ctouch%20owned/path
1968 cloning subrepo s from ssh://fakehost%7Ctouch%20owned/path
1969 abort: no suitable response from remote hg!
1969 abort: no suitable response from remote hg!
1970 [255]
1970 [255]
1971 $ [ ! -f owned ] || echo 'you got owned'
1971 $ [ ! -f owned ] || echo 'you got owned'
1972
1972
1973 and bad usernames:
1973 and bad usernames:
1974 $ cd malicious-proxycommand
1974 $ cd malicious-proxycommand
1975 $ echo 's = [hg]ssh://-oProxyCommand=touch owned@example.com/path' > .hgsub
1975 $ echo 's = [hg]ssh://-oProxyCommand=touch owned@example.com/path' > .hgsub
1976 $ hg ci -m 'owned username'
1976 $ hg ci -m 'owned username'
1977 $ cd ..
1977 $ cd ..
1978 $ rm -r malicious-proxycommand-clone
1978 $ rm -r malicious-proxycommand-clone
1979 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1979 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1980 updating to branch default
1980 updating to branch default
1981 cloning subrepo s from ssh://-oProxyCommand%3Dtouch%20owned@example.com/path
1981 cloning subrepo s from ssh://-oProxyCommand%3Dtouch%20owned@example.com/path
1982 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch owned@example.com/path' (in subrepository "s")
1982 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch owned@example.com/path' (in subrepository "s")
1983 [255]
1983 [255]
1984
1984
1985 Test convert subrepositories including merge (issue5526):
1985 Test convert subrepositories including merge (issue5526):
1986
1986
1987 $ hg init tconv
1987 $ hg init tconv
1988 $ hg convert --config extensions.convert= -q t/s tconv/s
1988 $ hg convert --config extensions.convert= -q t/s tconv/s
1989 $ hg convert --config extensions.convert= -q t/s/ss tconv/s/ss
1989 $ hg convert --config extensions.convert= -q t/s/ss tconv/s/ss
1990 $ hg convert --config extensions.convert= -q t/t tconv/t
1990 $ hg convert --config extensions.convert= -q t/t tconv/t
1991
1991
1992 convert shouldn't fail because of pseudo filenode:
1992 convert shouldn't fail because of pseudo filenode:
1993
1993
1994 $ hg convert --config extensions.convert= t tconv
1994 $ hg convert --config extensions.convert= t tconv
1995 scanning source...
1995 scanning source...
1996 sorting...
1996 sorting...
1997 converting...
1997 converting...
1998 17 0
1998 17 0
1999 16 1
1999 16 1
2000 15 2
2000 15 2
2001 14 3
2001 14 3
2002 13 4
2002 13 4
2003 12 5
2003 12 5
2004 11 6
2004 11 6
2005 10 7
2005 10 7
2006 9 8
2006 9 8
2007 8 9
2007 8 9
2008 7 10
2008 7 10
2009 6 11
2009 6 11
2010 5 12
2010 5 12
2011 4 13
2011 4 13
2012 3 rm2
2012 3 rm2
2013 2 phasecheck4
2013 2 phasecheck4
2014 1 16
2014 1 16
2015 0 branch before subrepo add
2015 0 branch before subrepo add
2016
2016
2017 converted .hgsubstate should point to valid nodes:
2017 converted .hgsubstate should point to valid nodes:
2018
2018
2019 $ hg up -R tconv 9
2019 $ hg up -R tconv 9
2020 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
2020 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
2021 $ cat tconv/.hgsubstate
2021 $ cat tconv/.hgsubstate
2022 fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
2022 fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
2023 60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t
2023 60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t
General Comments 0
You need to be logged in to leave comments. Login now