##// END OF EJS Templates
subrepo: add regression test for issue3870
Kevin Bullock -
r19013:2b34d004 default
parent child Browse files
Show More
@@ -1,534 +1,559 b''
1 $ "$TESTDIR/hghave" git || exit 80
1 $ "$TESTDIR/hghave" git || exit 80
2
2
3 make git commits repeatable
3 make git commits repeatable
4
4
5 $ echo "[core]" >> $HOME/.gitconfig
5 $ echo "[core]" >> $HOME/.gitconfig
6 $ echo "autocrlf = false" >> $HOME/.gitconfig
6 $ echo "autocrlf = false" >> $HOME/.gitconfig
7 $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
7 $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
8 $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
8 $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
9 $ GIT_AUTHOR_DATE='1234567891 +0000'; export GIT_AUTHOR_DATE
9 $ GIT_AUTHOR_DATE='1234567891 +0000'; export GIT_AUTHOR_DATE
10 $ GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME
10 $ GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME
11 $ GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL
11 $ GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL
12 $ GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE
12 $ GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE
13
13
14 root hg repo
14 root hg repo
15
15
16 $ hg init t
16 $ hg init t
17 $ cd t
17 $ cd t
18 $ echo a > a
18 $ echo a > a
19 $ hg add a
19 $ hg add a
20 $ hg commit -m a
20 $ hg commit -m a
21 $ cd ..
21 $ cd ..
22
22
23 new external git repo
23 new external git repo
24
24
25 $ mkdir gitroot
25 $ mkdir gitroot
26 $ cd gitroot
26 $ cd gitroot
27 $ git init -q
27 $ git init -q
28 $ echo g > g
28 $ echo g > g
29 $ git add g
29 $ git add g
30 $ git commit -q -m g
30 $ git commit -q -m g
31
31
32 add subrepo clone
32 add subrepo clone
33
33
34 $ cd ../t
34 $ cd ../t
35 $ echo 's = [git]../gitroot' > .hgsub
35 $ echo 's = [git]../gitroot' > .hgsub
36 $ git clone -q ../gitroot s
36 $ git clone -q ../gitroot s
37 $ hg add .hgsub
37 $ hg add .hgsub
38 $ hg commit -m 'new git subrepo'
38 $ hg commit -m 'new git subrepo'
39 $ hg debugsub
39 $ hg debugsub
40 path s
40 path s
41 source ../gitroot
41 source ../gitroot
42 revision da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
42 revision da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
43
43
44 record a new commit from upstream from a different branch
44 record a new commit from upstream from a different branch
45
45
46 $ cd ../gitroot
46 $ cd ../gitroot
47 $ git checkout -q -b testing
47 $ git checkout -q -b testing
48 $ echo gg >> g
48 $ echo gg >> g
49 $ git commit -q -a -m gg
49 $ git commit -q -a -m gg
50
50
51 $ cd ../t/s
51 $ cd ../t/s
52 $ git pull -q >/dev/null 2>/dev/null
52 $ git pull -q >/dev/null 2>/dev/null
53 $ git checkout -q -b testing origin/testing >/dev/null
53 $ git checkout -q -b testing origin/testing >/dev/null
54
54
55 $ cd ..
55 $ cd ..
56 $ hg status --subrepos
56 $ hg status --subrepos
57 M s/g
57 M s/g
58 $ hg commit -m 'update git subrepo'
58 $ hg commit -m 'update git subrepo'
59 $ hg debugsub
59 $ hg debugsub
60 path s
60 path s
61 source ../gitroot
61 source ../gitroot
62 revision 126f2a14290cd5ce061fdedc430170e8d39e1c5a
62 revision 126f2a14290cd5ce061fdedc430170e8d39e1c5a
63
63
64 make $GITROOT pushable, by replacing it with a clone with nothing checked out
64 make $GITROOT pushable, by replacing it with a clone with nothing checked out
65
65
66 $ cd ..
66 $ cd ..
67 $ git clone gitroot gitrootbare --bare -q
67 $ git clone gitroot gitrootbare --bare -q
68 $ rm -rf gitroot
68 $ rm -rf gitroot
69 $ mv gitrootbare gitroot
69 $ mv gitrootbare gitroot
70
70
71 clone root
71 clone root
72
72
73 $ cd t
73 $ cd t
74 $ hg clone . ../tc
74 $ hg clone . ../tc
75 updating to branch default
75 updating to branch default
76 cloning subrepo s from $TESTTMP/gitroot
76 cloning subrepo s from $TESTTMP/gitroot
77 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
77 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
78 $ cd ../tc
78 $ cd ../tc
79 $ hg debugsub
79 $ hg debugsub
80 path s
80 path s
81 source ../gitroot
81 source ../gitroot
82 revision 126f2a14290cd5ce061fdedc430170e8d39e1c5a
82 revision 126f2a14290cd5ce061fdedc430170e8d39e1c5a
83
83
84 update to previous substate
84 update to previous substate
85
85
86 $ hg update 1 -q
86 $ hg update 1 -q
87 $ cat s/g
87 $ cat s/g
88 g
88 g
89 $ hg debugsub
89 $ hg debugsub
90 path s
90 path s
91 source ../gitroot
91 source ../gitroot
92 revision da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
92 revision da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
93
93
94 clone root, make local change
94 clone root, make local change
95
95
96 $ cd ../t
96 $ cd ../t
97 $ hg clone . ../ta
97 $ hg clone . ../ta
98 updating to branch default
98 updating to branch default
99 cloning subrepo s from $TESTTMP/gitroot
99 cloning subrepo s from $TESTTMP/gitroot
100 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
100 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
101
101
102 $ cd ../ta
102 $ cd ../ta
103 $ echo ggg >> s/g
103 $ echo ggg >> s/g
104 $ hg status --subrepos
104 $ hg status --subrepos
105 M s/g
105 M s/g
106 $ hg commit --subrepos -m ggg
106 $ hg commit --subrepos -m ggg
107 committing subrepository s
107 committing subrepository s
108 $ hg debugsub
108 $ hg debugsub
109 path s
109 path s
110 source ../gitroot
110 source ../gitroot
111 revision 79695940086840c99328513acbe35f90fcd55e57
111 revision 79695940086840c99328513acbe35f90fcd55e57
112
112
113 clone root separately, make different local change
113 clone root separately, make different local change
114
114
115 $ cd ../t
115 $ cd ../t
116 $ hg clone . ../tb
116 $ hg clone . ../tb
117 updating to branch default
117 updating to branch default
118 cloning subrepo s from $TESTTMP/gitroot
118 cloning subrepo s from $TESTTMP/gitroot
119 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
119 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
120
120
121 $ cd ../tb/s
121 $ cd ../tb/s
122 $ echo f > f
122 $ echo f > f
123 $ git add f
123 $ git add f
124 $ cd ..
124 $ cd ..
125
125
126 $ hg status --subrepos
126 $ hg status --subrepos
127 A s/f
127 A s/f
128 $ hg commit --subrepos -m f
128 $ hg commit --subrepos -m f
129 committing subrepository s
129 committing subrepository s
130 $ hg debugsub
130 $ hg debugsub
131 path s
131 path s
132 source ../gitroot
132 source ../gitroot
133 revision aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
133 revision aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
134
134
135 user b push changes
135 user b push changes
136
136
137 $ hg push 2>/dev/null
137 $ hg push 2>/dev/null
138 pushing to $TESTTMP/t (glob)
138 pushing to $TESTTMP/t (glob)
139 pushing branch testing of subrepo s
139 pushing branch testing of subrepo s
140 searching for changes
140 searching for changes
141 adding changesets
141 adding changesets
142 adding manifests
142 adding manifests
143 adding file changes
143 adding file changes
144 added 1 changesets with 1 changes to 1 files
144 added 1 changesets with 1 changes to 1 files
145
145
146 user a pulls, merges, commits
146 user a pulls, merges, commits
147
147
148 $ cd ../ta
148 $ cd ../ta
149 $ hg pull
149 $ hg pull
150 pulling from $TESTTMP/t (glob)
150 pulling from $TESTTMP/t (glob)
151 searching for changes
151 searching for changes
152 adding changesets
152 adding changesets
153 adding manifests
153 adding manifests
154 adding file changes
154 adding file changes
155 added 1 changesets with 1 changes to 1 files (+1 heads)
155 added 1 changesets with 1 changes to 1 files (+1 heads)
156 (run 'hg heads' to see heads, 'hg merge' to merge)
156 (run 'hg heads' to see heads, 'hg merge' to merge)
157 $ hg merge 2>/dev/null
157 $ hg merge 2>/dev/null
158 pulling subrepo s from $TESTTMP/gitroot
158 pulling subrepo s from $TESTTMP/gitroot
159 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
159 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
160 (branch merge, don't forget to commit)
160 (branch merge, don't forget to commit)
161 $ cat s/f
161 $ cat s/f
162 f
162 f
163 $ cat s/g
163 $ cat s/g
164 g
164 g
165 gg
165 gg
166 ggg
166 ggg
167 $ hg commit --subrepos -m 'merge'
167 $ hg commit --subrepos -m 'merge'
168 committing subrepository s
168 committing subrepository s
169 $ hg status --subrepos --rev 1:5
169 $ hg status --subrepos --rev 1:5
170 M .hgsubstate
170 M .hgsubstate
171 M s/g
171 M s/g
172 A s/f
172 A s/f
173 $ hg debugsub
173 $ hg debugsub
174 path s
174 path s
175 source ../gitroot
175 source ../gitroot
176 revision f47b465e1bce645dbf37232a00574aa1546ca8d3
176 revision f47b465e1bce645dbf37232a00574aa1546ca8d3
177 $ hg push 2>/dev/null
177 $ hg push 2>/dev/null
178 pushing to $TESTTMP/t (glob)
178 pushing to $TESTTMP/t (glob)
179 pushing branch testing of subrepo s
179 pushing branch testing of subrepo s
180 searching for changes
180 searching for changes
181 adding changesets
181 adding changesets
182 adding manifests
182 adding manifests
183 adding file changes
183 adding file changes
184 added 2 changesets with 2 changes to 1 files
184 added 2 changesets with 2 changes to 1 files
185
185
186 make upstream git changes
186 make upstream git changes
187
187
188 $ cd ..
188 $ cd ..
189 $ git clone -q gitroot gitclone
189 $ git clone -q gitroot gitclone
190 $ cd gitclone
190 $ cd gitclone
191 $ echo ff >> f
191 $ echo ff >> f
192 $ git commit -q -a -m ff
192 $ git commit -q -a -m ff
193 $ echo fff >> f
193 $ echo fff >> f
194 $ git commit -q -a -m fff
194 $ git commit -q -a -m fff
195 $ git push origin testing 2>/dev/null
195 $ git push origin testing 2>/dev/null
196
196
197 make and push changes to hg without updating the subrepo
197 make and push changes to hg without updating the subrepo
198
198
199 $ cd ../t
199 $ cd ../t
200 $ hg clone . ../td
200 $ hg clone . ../td
201 updating to branch default
201 updating to branch default
202 cloning subrepo s from $TESTTMP/gitroot
202 cloning subrepo s from $TESTTMP/gitroot
203 checking out detached HEAD in subrepo s
203 checking out detached HEAD in subrepo s
204 check out a git branch if you intend to make changes
204 check out a git branch if you intend to make changes
205 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
205 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
206 $ cd ../td
206 $ cd ../td
207 $ echo aa >> a
207 $ echo aa >> a
208 $ hg commit -m aa
208 $ hg commit -m aa
209 $ hg push
209 $ hg push
210 pushing to $TESTTMP/t (glob)
210 pushing to $TESTTMP/t (glob)
211 searching for changes
211 searching for changes
212 adding changesets
212 adding changesets
213 adding manifests
213 adding manifests
214 adding file changes
214 adding file changes
215 added 1 changesets with 1 changes to 1 files
215 added 1 changesets with 1 changes to 1 files
216
216
217 sync to upstream git, distribute changes
217 sync to upstream git, distribute changes
218
218
219 $ cd ../ta
219 $ cd ../ta
220 $ hg pull -u -q
220 $ hg pull -u -q
221 $ cd s
221 $ cd s
222 $ git pull -q >/dev/null 2>/dev/null
222 $ git pull -q >/dev/null 2>/dev/null
223 $ cd ..
223 $ cd ..
224 $ hg commit -m 'git upstream sync'
224 $ hg commit -m 'git upstream sync'
225 $ hg debugsub
225 $ hg debugsub
226 path s
226 path s
227 source ../gitroot
227 source ../gitroot
228 revision 32a343883b74769118bb1d3b4b1fbf9156f4dddc
228 revision 32a343883b74769118bb1d3b4b1fbf9156f4dddc
229 $ hg push -q
229 $ hg push -q
230
230
231 $ cd ../tb
231 $ cd ../tb
232 $ hg pull -q
232 $ hg pull -q
233 $ hg update 2>/dev/null
233 $ hg update 2>/dev/null
234 pulling subrepo s from $TESTTMP/gitroot
234 pulling subrepo s from $TESTTMP/gitroot
235 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
235 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
236 $ hg debugsub
236 $ hg debugsub
237 path s
237 path s
238 source ../gitroot
238 source ../gitroot
239 revision 32a343883b74769118bb1d3b4b1fbf9156f4dddc
239 revision 32a343883b74769118bb1d3b4b1fbf9156f4dddc
240
240
241 create a new git branch
242
243 $ cd s
244 $ git checkout -b b2
245 Switched to a new branch 'b2'
246 $ echo a>a
247 $ git add a
248 $ git commit -qm 'add a'
249 $ cd ..
250 $ hg commit -m 'add branch in s'
251
252 pulling new git branch should not create tracking branch named 'origin/b2'
253 (issue3870)
254 $ cd ../td/s
255 $ git remote set-url origin $TESTTMP/tb/s
256 $ cd ..
257 $ hg pull -q ../tb
258 $ hg up
259 From $TESTTMP/tb/s
260 * [new branch] b2 -> origin/b2
261 Previous HEAD position was f47b465... merge
262 Switched to a new branch 'b2'
263 pulling subrepo s from $TESTTMP/tb/s
264 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
265
241 update to a revision without the subrepo, keeping the local git repository
266 update to a revision without the subrepo, keeping the local git repository
242
267
243 $ cd ../t
268 $ cd ../t
244 $ hg up 0
269 $ hg up 0
245 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
270 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
246 $ ls -a s
271 $ ls -a s
247 .
272 .
248 ..
273 ..
249 .git
274 .git
250
275
251 $ hg up 2
276 $ hg up 2
252 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
277 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
253 $ ls -a s
278 $ ls -a s
254 .
279 .
255 ..
280 ..
256 .git
281 .git
257 g
282 g
258
283
259 archive subrepos
284 archive subrepos
260
285
261 $ cd ../tc
286 $ cd ../tc
262 $ hg pull -q
287 $ hg pull -q
263 $ hg archive --subrepos -r 5 ../archive 2>/dev/null
288 $ hg archive --subrepos -r 5 ../archive 2>/dev/null
264 pulling subrepo s from $TESTTMP/gitroot
289 pulling subrepo s from $TESTTMP/gitroot
265 $ cd ../archive
290 $ cd ../archive
266 $ cat s/f
291 $ cat s/f
267 f
292 f
268 $ cat s/g
293 $ cat s/g
269 g
294 g
270 gg
295 gg
271 ggg
296 ggg
272
297
273 $ hg -R ../tc archive --subrepo -r 5 -X ../tc/**f ../archive_x 2>/dev/null
298 $ hg -R ../tc archive --subrepo -r 5 -X ../tc/**f ../archive_x 2>/dev/null
274 $ find ../archive_x | sort | grep -v pax_global_header
299 $ find ../archive_x | sort | grep -v pax_global_header
275 ../archive_x
300 ../archive_x
276 ../archive_x/.hg_archival.txt
301 ../archive_x/.hg_archival.txt
277 ../archive_x/.hgsub
302 ../archive_x/.hgsub
278 ../archive_x/.hgsubstate
303 ../archive_x/.hgsubstate
279 ../archive_x/a
304 ../archive_x/a
280 ../archive_x/s
305 ../archive_x/s
281 ../archive_x/s/g
306 ../archive_x/s/g
282
307
283 create nested repo
308 create nested repo
284
309
285 $ cd ..
310 $ cd ..
286 $ hg init outer
311 $ hg init outer
287 $ cd outer
312 $ cd outer
288 $ echo b>b
313 $ echo b>b
289 $ hg add b
314 $ hg add b
290 $ hg commit -m b
315 $ hg commit -m b
291
316
292 $ hg clone ../t inner
317 $ hg clone ../t inner
293 updating to branch default
318 updating to branch default
294 cloning subrepo s from $TESTTMP/gitroot
319 cloning subrepo s from $TESTTMP/gitroot
295 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
320 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
296 $ echo inner = inner > .hgsub
321 $ echo inner = inner > .hgsub
297 $ hg add .hgsub
322 $ hg add .hgsub
298 $ hg commit -m 'nested sub'
323 $ hg commit -m 'nested sub'
299
324
300 nested commit
325 nested commit
301
326
302 $ echo ffff >> inner/s/f
327 $ echo ffff >> inner/s/f
303 $ hg status --subrepos
328 $ hg status --subrepos
304 M inner/s/f
329 M inner/s/f
305 $ hg commit --subrepos -m nested
330 $ hg commit --subrepos -m nested
306 committing subrepository inner
331 committing subrepository inner
307 committing subrepository inner/s (glob)
332 committing subrepository inner/s (glob)
308
333
309 nested archive
334 nested archive
310
335
311 $ hg archive --subrepos ../narchive
336 $ hg archive --subrepos ../narchive
312 $ ls ../narchive/inner/s | grep -v pax_global_header
337 $ ls ../narchive/inner/s | grep -v pax_global_header
313 f
338 f
314 g
339 g
315
340
316 relative source expansion
341 relative source expansion
317
342
318 $ cd ..
343 $ cd ..
319 $ mkdir d
344 $ mkdir d
320 $ hg clone t d/t
345 $ hg clone t d/t
321 updating to branch default
346 updating to branch default
322 cloning subrepo s from $TESTTMP/gitroot
347 cloning subrepo s from $TESTTMP/gitroot
323 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
348 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
324
349
325 Don't crash if the subrepo is missing
350 Don't crash if the subrepo is missing
326
351
327 $ hg clone t missing -q
352 $ hg clone t missing -q
328 $ cd missing
353 $ cd missing
329 $ rm -rf s
354 $ rm -rf s
330 $ hg status -S
355 $ hg status -S
331 $ hg sum | grep commit
356 $ hg sum | grep commit
332 commit: 1 subrepos
357 commit: 1 subrepos
333 $ hg push -q
358 $ hg push -q
334 abort: subrepo s is missing (in subrepo s)
359 abort: subrepo s is missing (in subrepo s)
335 [255]
360 [255]
336 $ hg commit --subrepos -qm missing
361 $ hg commit --subrepos -qm missing
337 abort: subrepo s is missing (in subrepo s)
362 abort: subrepo s is missing (in subrepo s)
338 [255]
363 [255]
339 $ hg update -C
364 $ hg update -C
340 cloning subrepo s from $TESTTMP/gitroot
365 cloning subrepo s from $TESTTMP/gitroot
341 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
366 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
342 $ hg sum | grep commit
367 $ hg sum | grep commit
343 commit: (clean)
368 commit: (clean)
344
369
345 Don't crash if the .hgsubstate entry is missing
370 Don't crash if the .hgsubstate entry is missing
346
371
347 $ hg update 1 -q
372 $ hg update 1 -q
348 $ hg rm .hgsubstate
373 $ hg rm .hgsubstate
349 $ hg commit .hgsubstate -m 'no substate'
374 $ hg commit .hgsubstate -m 'no substate'
350 nothing changed
375 nothing changed
351 [1]
376 [1]
352 $ hg tag -l nosubstate
377 $ hg tag -l nosubstate
353 $ hg manifest
378 $ hg manifest
354 .hgsub
379 .hgsub
355 .hgsubstate
380 .hgsubstate
356 a
381 a
357
382
358 $ hg status -S
383 $ hg status -S
359 R .hgsubstate
384 R .hgsubstate
360 $ hg sum | grep commit
385 $ hg sum | grep commit
361 commit: 1 removed, 1 subrepos (new branch head)
386 commit: 1 removed, 1 subrepos (new branch head)
362
387
363 $ hg commit -m 'restore substate'
388 $ hg commit -m 'restore substate'
364 nothing changed
389 nothing changed
365 [1]
390 [1]
366 $ hg manifest
391 $ hg manifest
367 .hgsub
392 .hgsub
368 .hgsubstate
393 .hgsubstate
369 a
394 a
370 $ hg sum | grep commit
395 $ hg sum | grep commit
371 commit: 1 removed, 1 subrepos (new branch head)
396 commit: 1 removed, 1 subrepos (new branch head)
372
397
373 $ hg update -qC nosubstate
398 $ hg update -qC nosubstate
374 $ ls s
399 $ ls s
375 g
400 g
376
401
377 issue3109: false positives in git diff-index
402 issue3109: false positives in git diff-index
378
403
379 $ hg update -q
404 $ hg update -q
380 $ touch -t 200001010000 s/g
405 $ touch -t 200001010000 s/g
381 $ hg status --subrepos
406 $ hg status --subrepos
382 $ touch -t 200001010000 s/g
407 $ touch -t 200001010000 s/g
383 $ hg sum | grep commit
408 $ hg sum | grep commit
384 commit: (clean)
409 commit: (clean)
385
410
386 Check hg update --clean
411 Check hg update --clean
387 $ cd $TESTTMP/ta
412 $ cd $TESTTMP/ta
388 $ echo > s/g
413 $ echo > s/g
389 $ cd s
414 $ cd s
390 $ echo c1 > f1
415 $ echo c1 > f1
391 $ echo c1 > f2
416 $ echo c1 > f2
392 $ git add f1
417 $ git add f1
393 $ cd ..
418 $ cd ..
394 $ hg status -S
419 $ hg status -S
395 M s/g
420 M s/g
396 A s/f1
421 A s/f1
397 $ ls s
422 $ ls s
398 f
423 f
399 f1
424 f1
400 f2
425 f2
401 g
426 g
402 $ hg update --clean
427 $ hg update --clean
403 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
428 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
404 $ hg status -S
429 $ hg status -S
405 $ ls s
430 $ ls s
406 f
431 f
407 f1
432 f1
408 f2
433 f2
409 g
434 g
410
435
411 Sticky subrepositories, no changes
436 Sticky subrepositories, no changes
412 $ cd $TESTTMP/ta
437 $ cd $TESTTMP/ta
413 $ hg id -n
438 $ hg id -n
414 7
439 7
415 $ cd s
440 $ cd s
416 $ git rev-parse HEAD
441 $ git rev-parse HEAD
417 32a343883b74769118bb1d3b4b1fbf9156f4dddc
442 32a343883b74769118bb1d3b4b1fbf9156f4dddc
418 $ cd ..
443 $ cd ..
419 $ hg update 1 > /dev/null 2>&1
444 $ hg update 1 > /dev/null 2>&1
420 $ hg id -n
445 $ hg id -n
421 1
446 1
422 $ cd s
447 $ cd s
423 $ git rev-parse HEAD
448 $ git rev-parse HEAD
424 da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
449 da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
425 $ cd ..
450 $ cd ..
426
451
427 Sticky subrepositorys, file changes
452 Sticky subrepositorys, file changes
428 $ touch s/f1
453 $ touch s/f1
429 $ cd s
454 $ cd s
430 $ git add f1
455 $ git add f1
431 $ cd ..
456 $ cd ..
432 $ hg id -n
457 $ hg id -n
433 1+
458 1+
434 $ cd s
459 $ cd s
435 $ git rev-parse HEAD
460 $ git rev-parse HEAD
436 da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
461 da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
437 $ cd ..
462 $ cd ..
438 $ hg update 4
463 $ hg update 4
439 subrepository sources for s differ
464 subrepository sources for s differ
440 use (l)ocal source (da5f5b1) or (r)emote source (aa84837)?
465 use (l)ocal source (da5f5b1) or (r)emote source (aa84837)?
441 l
466 l
442 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
467 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
443 $ hg id -n
468 $ hg id -n
444 4+
469 4+
445 $ cd s
470 $ cd s
446 $ git rev-parse HEAD
471 $ git rev-parse HEAD
447 da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
472 da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
448 $ cd ..
473 $ cd ..
449 $ hg update --clean tip > /dev/null 2>&1
474 $ hg update --clean tip > /dev/null 2>&1
450
475
451 Sticky subrepository, revision updates
476 Sticky subrepository, revision updates
452 $ hg id -n
477 $ hg id -n
453 7
478 7
454 $ cd s
479 $ cd s
455 $ git rev-parse HEAD
480 $ git rev-parse HEAD
456 32a343883b74769118bb1d3b4b1fbf9156f4dddc
481 32a343883b74769118bb1d3b4b1fbf9156f4dddc
457 $ cd ..
482 $ cd ..
458 $ cd s
483 $ cd s
459 $ git checkout aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
484 $ git checkout aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
460 Previous HEAD position was 32a3438... fff
485 Previous HEAD position was 32a3438... fff
461 HEAD is now at aa84837... f
486 HEAD is now at aa84837... f
462 $ cd ..
487 $ cd ..
463 $ hg update 1
488 $ hg update 1
464 subrepository sources for s differ (in checked out version)
489 subrepository sources for s differ (in checked out version)
465 use (l)ocal source (32a3438) or (r)emote source (da5f5b1)?
490 use (l)ocal source (32a3438) or (r)emote source (da5f5b1)?
466 l
491 l
467 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
492 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
468 $ hg id -n
493 $ hg id -n
469 1+
494 1+
470 $ cd s
495 $ cd s
471 $ git rev-parse HEAD
496 $ git rev-parse HEAD
472 aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
497 aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
473 $ cd ..
498 $ cd ..
474
499
475 Sticky subrepository, file changes and revision updates
500 Sticky subrepository, file changes and revision updates
476 $ touch s/f1
501 $ touch s/f1
477 $ cd s
502 $ cd s
478 $ git add f1
503 $ git add f1
479 $ git rev-parse HEAD
504 $ git rev-parse HEAD
480 aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
505 aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
481 $ cd ..
506 $ cd ..
482 $ hg id -n
507 $ hg id -n
483 1+
508 1+
484 $ hg update 7
509 $ hg update 7
485 subrepository sources for s differ
510 subrepository sources for s differ
486 use (l)ocal source (32a3438) or (r)emote source (32a3438)?
511 use (l)ocal source (32a3438) or (r)emote source (32a3438)?
487 l
512 l
488 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
513 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
489 $ hg id -n
514 $ hg id -n
490 7+
515 7+
491 $ cd s
516 $ cd s
492 $ git rev-parse HEAD
517 $ git rev-parse HEAD
493 aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
518 aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
494 $ cd ..
519 $ cd ..
495
520
496 Sticky repository, update --clean
521 Sticky repository, update --clean
497 $ hg update --clean tip 2>/dev/null
522 $ hg update --clean tip 2>/dev/null
498 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
523 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
499 $ hg id -n
524 $ hg id -n
500 7
525 7
501 $ cd s
526 $ cd s
502 $ git rev-parse HEAD
527 $ git rev-parse HEAD
503 32a343883b74769118bb1d3b4b1fbf9156f4dddc
528 32a343883b74769118bb1d3b4b1fbf9156f4dddc
504 $ cd ..
529 $ cd ..
505
530
506 Test subrepo already at intended revision:
531 Test subrepo already at intended revision:
507 $ cd s
532 $ cd s
508 $ git checkout 32a343883b74769118bb1d3b4b1fbf9156f4dddc
533 $ git checkout 32a343883b74769118bb1d3b4b1fbf9156f4dddc
509 HEAD is now at 32a3438... fff
534 HEAD is now at 32a3438... fff
510 $ cd ..
535 $ cd ..
511 $ hg update 1
536 $ hg update 1
512 Previous HEAD position was 32a3438... fff
537 Previous HEAD position was 32a3438... fff
513 HEAD is now at da5f5b1... g
538 HEAD is now at da5f5b1... g
514 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
539 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
515 $ hg id -n
540 $ hg id -n
516 1
541 1
517 $ cd s
542 $ cd s
518 $ git rev-parse HEAD
543 $ git rev-parse HEAD
519 da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
544 da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
520 $ cd ..
545 $ cd ..
521
546
522 Test forgetting files, not implemented in git subrepo, used to
547 Test forgetting files, not implemented in git subrepo, used to
523 traceback
548 traceback
524 #if no-windows
549 #if no-windows
525 $ hg forget 'notafile*'
550 $ hg forget 'notafile*'
526 notafile*: No such file or directory
551 notafile*: No such file or directory
527 [1]
552 [1]
528 #else
553 #else
529 $ hg forget 'notafile'
554 $ hg forget 'notafile'
530 notafile: * (glob)
555 notafile: * (glob)
531 [1]
556 [1]
532 #endif
557 #endif
533
558
534 $ cd ..
559 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now