##// END OF EJS Templates
tests: discard useless "(glob)" in "reverting subrepo" lines
FUJIWARA Katsunori -
r23937:fd5b9417 stable
parent child Browse files
Show More
@@ -1,804 +1,804 b''
1 #require git
1 #require git
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 $ GIT_CONFIG_NOSYSTEM=1; export GIT_CONFIG_NOSYSTEM
13 $ GIT_CONFIG_NOSYSTEM=1; export GIT_CONFIG_NOSYSTEM
14
14
15 root hg repo
15 root hg repo
16
16
17 $ hg init t
17 $ hg init t
18 $ cd t
18 $ cd t
19 $ echo a > a
19 $ echo a > a
20 $ hg add a
20 $ hg add a
21 $ hg commit -m a
21 $ hg commit -m a
22 $ cd ..
22 $ cd ..
23
23
24 new external git repo
24 new external git repo
25
25
26 $ mkdir gitroot
26 $ mkdir gitroot
27 $ cd gitroot
27 $ cd gitroot
28 $ git init -q
28 $ git init -q
29 $ echo g > g
29 $ echo g > g
30 $ git add g
30 $ git add g
31 $ git commit -q -m g
31 $ git commit -q -m g
32
32
33 add subrepo clone
33 add subrepo clone
34
34
35 $ cd ../t
35 $ cd ../t
36 $ echo 's = [git]../gitroot' > .hgsub
36 $ echo 's = [git]../gitroot' > .hgsub
37 $ git clone -q ../gitroot s
37 $ git clone -q ../gitroot s
38 $ hg add .hgsub
38 $ hg add .hgsub
39 $ hg commit -m 'new git subrepo'
39 $ hg commit -m 'new git subrepo'
40 $ hg debugsub
40 $ hg debugsub
41 path s
41 path s
42 source ../gitroot
42 source ../gitroot
43 revision da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
43 revision da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
44
44
45 record a new commit from upstream from a different branch
45 record a new commit from upstream from a different branch
46
46
47 $ cd ../gitroot
47 $ cd ../gitroot
48 $ git checkout -q -b testing
48 $ git checkout -q -b testing
49 $ echo gg >> g
49 $ echo gg >> g
50 $ git commit -q -a -m gg
50 $ git commit -q -a -m gg
51
51
52 $ cd ../t/s
52 $ cd ../t/s
53 $ git pull -q >/dev/null 2>/dev/null
53 $ git pull -q >/dev/null 2>/dev/null
54 $ git checkout -q -b testing origin/testing >/dev/null
54 $ git checkout -q -b testing origin/testing >/dev/null
55
55
56 $ cd ..
56 $ cd ..
57 $ hg status --subrepos
57 $ hg status --subrepos
58 M s/g
58 M s/g
59 $ hg commit -m 'update git subrepo'
59 $ hg commit -m 'update git subrepo'
60 $ hg debugsub
60 $ hg debugsub
61 path s
61 path s
62 source ../gitroot
62 source ../gitroot
63 revision 126f2a14290cd5ce061fdedc430170e8d39e1c5a
63 revision 126f2a14290cd5ce061fdedc430170e8d39e1c5a
64
64
65 make $GITROOT pushable, by replacing it with a clone with nothing checked out
65 make $GITROOT pushable, by replacing it with a clone with nothing checked out
66
66
67 $ cd ..
67 $ cd ..
68 $ git clone gitroot gitrootbare --bare -q
68 $ git clone gitroot gitrootbare --bare -q
69 $ rm -rf gitroot
69 $ rm -rf gitroot
70 $ mv gitrootbare gitroot
70 $ mv gitrootbare gitroot
71
71
72 clone root
72 clone root
73
73
74 $ cd t
74 $ cd t
75 $ hg clone . ../tc 2> /dev/null
75 $ hg clone . ../tc 2> /dev/null
76 updating to branch default
76 updating to branch default
77 cloning subrepo s from $TESTTMP/gitroot
77 cloning subrepo s from $TESTTMP/gitroot
78 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
78 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
79 $ cd ../tc
79 $ cd ../tc
80 $ hg debugsub
80 $ hg debugsub
81 path s
81 path s
82 source ../gitroot
82 source ../gitroot
83 revision 126f2a14290cd5ce061fdedc430170e8d39e1c5a
83 revision 126f2a14290cd5ce061fdedc430170e8d39e1c5a
84
84
85 update to previous substate
85 update to previous substate
86
86
87 $ hg update 1 -q
87 $ hg update 1 -q
88 $ cat s/g
88 $ cat s/g
89 g
89 g
90 $ hg debugsub
90 $ hg debugsub
91 path s
91 path s
92 source ../gitroot
92 source ../gitroot
93 revision da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
93 revision da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
94
94
95 clone root, make local change
95 clone root, make local change
96
96
97 $ cd ../t
97 $ cd ../t
98 $ hg clone . ../ta 2> /dev/null
98 $ hg clone . ../ta 2> /dev/null
99 updating to branch default
99 updating to branch default
100 cloning subrepo s from $TESTTMP/gitroot
100 cloning subrepo s from $TESTTMP/gitroot
101 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
101 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
102
102
103 $ cd ../ta
103 $ cd ../ta
104 $ echo ggg >> s/g
104 $ echo ggg >> s/g
105 $ hg status --subrepos
105 $ hg status --subrepos
106 M s/g
106 M s/g
107 $ hg diff --subrepos
107 $ hg diff --subrepos
108 diff --git a/s/g b/s/g
108 diff --git a/s/g b/s/g
109 index 089258f..85341ee 100644
109 index 089258f..85341ee 100644
110 --- a/s/g
110 --- a/s/g
111 +++ b/s/g
111 +++ b/s/g
112 @@ -1,2 +1,3 @@
112 @@ -1,2 +1,3 @@
113 g
113 g
114 gg
114 gg
115 +ggg (no-eol)
115 +ggg (no-eol)
116 $ hg commit --subrepos -m ggg
116 $ hg commit --subrepos -m ggg
117 committing subrepository s
117 committing subrepository s
118 $ hg debugsub
118 $ hg debugsub
119 path s
119 path s
120 source ../gitroot
120 source ../gitroot
121 revision 79695940086840c99328513acbe35f90fcd55e57
121 revision 79695940086840c99328513acbe35f90fcd55e57
122
122
123 clone root separately, make different local change
123 clone root separately, make different local change
124
124
125 $ cd ../t
125 $ cd ../t
126 $ hg clone . ../tb 2> /dev/null
126 $ hg clone . ../tb 2> /dev/null
127 updating to branch default
127 updating to branch default
128 cloning subrepo s from $TESTTMP/gitroot
128 cloning subrepo s from $TESTTMP/gitroot
129 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
129 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
130
130
131 $ cd ../tb/s
131 $ cd ../tb/s
132 $ hg status --subrepos
132 $ hg status --subrepos
133 $ echo f > f
133 $ echo f > f
134 $ hg status --subrepos
134 $ hg status --subrepos
135 ? s/f
135 ? s/f
136 $ git add f
136 $ git add f
137 $ cd ..
137 $ cd ..
138
138
139 $ hg status --subrepos
139 $ hg status --subrepos
140 A s/f
140 A s/f
141 $ hg commit --subrepos -m f
141 $ hg commit --subrepos -m f
142 committing subrepository s
142 committing subrepository s
143 $ hg debugsub
143 $ hg debugsub
144 path s
144 path s
145 source ../gitroot
145 source ../gitroot
146 revision aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
146 revision aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
147
147
148 user b push changes
148 user b push changes
149
149
150 $ hg push 2>/dev/null
150 $ hg push 2>/dev/null
151 pushing to $TESTTMP/t (glob)
151 pushing to $TESTTMP/t (glob)
152 pushing branch testing of subrepo s
152 pushing branch testing of subrepo s
153 searching for changes
153 searching for changes
154 adding changesets
154 adding changesets
155 adding manifests
155 adding manifests
156 adding file changes
156 adding file changes
157 added 1 changesets with 1 changes to 1 files
157 added 1 changesets with 1 changes to 1 files
158
158
159 user a pulls, merges, commits
159 user a pulls, merges, commits
160
160
161 $ cd ../ta
161 $ cd ../ta
162 $ hg pull
162 $ hg pull
163 pulling from $TESTTMP/t (glob)
163 pulling from $TESTTMP/t (glob)
164 searching for changes
164 searching for changes
165 adding changesets
165 adding changesets
166 adding manifests
166 adding manifests
167 adding file changes
167 adding file changes
168 added 1 changesets with 1 changes to 1 files (+1 heads)
168 added 1 changesets with 1 changes to 1 files (+1 heads)
169 (run 'hg heads' to see heads, 'hg merge' to merge)
169 (run 'hg heads' to see heads, 'hg merge' to merge)
170 $ hg merge 2>/dev/null
170 $ hg merge 2>/dev/null
171 subrepository s diverged (local revision: 7969594, remote revision: aa84837)
171 subrepository s diverged (local revision: 7969594, remote revision: aa84837)
172 (M)erge, keep (l)ocal or keep (r)emote? m
172 (M)erge, keep (l)ocal or keep (r)emote? m
173 pulling subrepo s from $TESTTMP/gitroot
173 pulling subrepo s from $TESTTMP/gitroot
174 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
174 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
175 (branch merge, don't forget to commit)
175 (branch merge, don't forget to commit)
176 $ cat s/f
176 $ cat s/f
177 f
177 f
178 $ cat s/g
178 $ cat s/g
179 g
179 g
180 gg
180 gg
181 ggg
181 ggg
182 $ hg commit --subrepos -m 'merge'
182 $ hg commit --subrepos -m 'merge'
183 committing subrepository s
183 committing subrepository s
184 $ hg status --subrepos --rev 1:5
184 $ hg status --subrepos --rev 1:5
185 M .hgsubstate
185 M .hgsubstate
186 M s/g
186 M s/g
187 A s/f
187 A s/f
188 $ hg debugsub
188 $ hg debugsub
189 path s
189 path s
190 source ../gitroot
190 source ../gitroot
191 revision f47b465e1bce645dbf37232a00574aa1546ca8d3
191 revision f47b465e1bce645dbf37232a00574aa1546ca8d3
192 $ hg push 2>/dev/null
192 $ hg push 2>/dev/null
193 pushing to $TESTTMP/t (glob)
193 pushing to $TESTTMP/t (glob)
194 pushing branch testing of subrepo s
194 pushing branch testing of subrepo s
195 searching for changes
195 searching for changes
196 adding changesets
196 adding changesets
197 adding manifests
197 adding manifests
198 adding file changes
198 adding file changes
199 added 2 changesets with 2 changes to 1 files
199 added 2 changesets with 2 changes to 1 files
200
200
201 make upstream git changes
201 make upstream git changes
202
202
203 $ cd ..
203 $ cd ..
204 $ git clone -q gitroot gitclone
204 $ git clone -q gitroot gitclone
205 $ cd gitclone
205 $ cd gitclone
206 $ echo ff >> f
206 $ echo ff >> f
207 $ git commit -q -a -m ff
207 $ git commit -q -a -m ff
208 $ echo fff >> f
208 $ echo fff >> f
209 $ git commit -q -a -m fff
209 $ git commit -q -a -m fff
210 $ git push origin testing 2>/dev/null
210 $ git push origin testing 2>/dev/null
211
211
212 make and push changes to hg without updating the subrepo
212 make and push changes to hg without updating the subrepo
213
213
214 $ cd ../t
214 $ cd ../t
215 $ hg clone . ../td 2>&1 | egrep -v '^Cloning into|^done\.'
215 $ hg clone . ../td 2>&1 | egrep -v '^Cloning into|^done\.'
216 updating to branch default
216 updating to branch default
217 cloning subrepo s from $TESTTMP/gitroot
217 cloning subrepo s from $TESTTMP/gitroot
218 checking out detached HEAD in subrepo s
218 checking out detached HEAD in subrepo s
219 check out a git branch if you intend to make changes
219 check out a git branch if you intend to make changes
220 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
220 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
221 $ cd ../td
221 $ cd ../td
222 $ echo aa >> a
222 $ echo aa >> a
223 $ hg commit -m aa
223 $ hg commit -m aa
224 $ hg push
224 $ hg push
225 pushing to $TESTTMP/t (glob)
225 pushing to $TESTTMP/t (glob)
226 searching for changes
226 searching for changes
227 adding changesets
227 adding changesets
228 adding manifests
228 adding manifests
229 adding file changes
229 adding file changes
230 added 1 changesets with 1 changes to 1 files
230 added 1 changesets with 1 changes to 1 files
231
231
232 sync to upstream git, distribute changes
232 sync to upstream git, distribute changes
233
233
234 $ cd ../ta
234 $ cd ../ta
235 $ hg pull -u -q
235 $ hg pull -u -q
236 $ cd s
236 $ cd s
237 $ git pull -q >/dev/null 2>/dev/null
237 $ git pull -q >/dev/null 2>/dev/null
238 $ cd ..
238 $ cd ..
239 $ hg commit -m 'git upstream sync'
239 $ hg commit -m 'git upstream sync'
240 $ hg debugsub
240 $ hg debugsub
241 path s
241 path s
242 source ../gitroot
242 source ../gitroot
243 revision 32a343883b74769118bb1d3b4b1fbf9156f4dddc
243 revision 32a343883b74769118bb1d3b4b1fbf9156f4dddc
244 $ hg push -q
244 $ hg push -q
245
245
246 $ cd ../tb
246 $ cd ../tb
247 $ hg pull -q
247 $ hg pull -q
248 $ hg update 2>/dev/null
248 $ hg update 2>/dev/null
249 pulling subrepo s from $TESTTMP/gitroot
249 pulling subrepo s from $TESTTMP/gitroot
250 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
250 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
251 $ hg debugsub
251 $ hg debugsub
252 path s
252 path s
253 source ../gitroot
253 source ../gitroot
254 revision 32a343883b74769118bb1d3b4b1fbf9156f4dddc
254 revision 32a343883b74769118bb1d3b4b1fbf9156f4dddc
255
255
256 create a new git branch
256 create a new git branch
257
257
258 $ cd s
258 $ cd s
259 $ git checkout -b b2
259 $ git checkout -b b2
260 Switched to a new branch 'b2'
260 Switched to a new branch 'b2'
261 $ echo a>a
261 $ echo a>a
262 $ git add a
262 $ git add a
263 $ git commit -qm 'add a'
263 $ git commit -qm 'add a'
264 $ cd ..
264 $ cd ..
265 $ hg commit -m 'add branch in s'
265 $ hg commit -m 'add branch in s'
266
266
267 pulling new git branch should not create tracking branch named 'origin/b2'
267 pulling new git branch should not create tracking branch named 'origin/b2'
268 (issue3870)
268 (issue3870)
269 $ cd ../td/s
269 $ cd ../td/s
270 $ git remote set-url origin $TESTTMP/tb/s
270 $ git remote set-url origin $TESTTMP/tb/s
271 $ git branch --no-track oldtesting
271 $ git branch --no-track oldtesting
272 $ cd ..
272 $ cd ..
273 $ hg pull -q ../tb
273 $ hg pull -q ../tb
274 $ hg up
274 $ hg up
275 From $TESTTMP/tb/s
275 From $TESTTMP/tb/s
276 * [new branch] b2 -> origin/b2
276 * [new branch] b2 -> origin/b2
277 Previous HEAD position was f47b465... merge
277 Previous HEAD position was f47b465... merge
278 Switched to a new branch 'b2'
278 Switched to a new branch 'b2'
279 pulling subrepo s from $TESTTMP/tb/s
279 pulling subrepo s from $TESTTMP/tb/s
280 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
280 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
281
281
282 update to a revision without the subrepo, keeping the local git repository
282 update to a revision without the subrepo, keeping the local git repository
283
283
284 $ cd ../t
284 $ cd ../t
285 $ hg up 0
285 $ hg up 0
286 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
286 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
287 $ ls -a s
287 $ ls -a s
288 .
288 .
289 ..
289 ..
290 .git
290 .git
291
291
292 $ hg up 2
292 $ hg up 2
293 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
293 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
294 $ ls -a s
294 $ ls -a s
295 .
295 .
296 ..
296 ..
297 .git
297 .git
298 g
298 g
299
299
300 archive subrepos
300 archive subrepos
301
301
302 $ cd ../tc
302 $ cd ../tc
303 $ hg pull -q
303 $ hg pull -q
304 $ hg archive --subrepos -r 5 ../archive 2>/dev/null
304 $ hg archive --subrepos -r 5 ../archive 2>/dev/null
305 pulling subrepo s from $TESTTMP/gitroot
305 pulling subrepo s from $TESTTMP/gitroot
306 $ cd ../archive
306 $ cd ../archive
307 $ cat s/f
307 $ cat s/f
308 f
308 f
309 $ cat s/g
309 $ cat s/g
310 g
310 g
311 gg
311 gg
312 ggg
312 ggg
313
313
314 $ hg -R ../tc archive --subrepo -r 5 -X ../tc/**f ../archive_x 2>/dev/null
314 $ hg -R ../tc archive --subrepo -r 5 -X ../tc/**f ../archive_x 2>/dev/null
315 $ find ../archive_x | sort | grep -v pax_global_header
315 $ find ../archive_x | sort | grep -v pax_global_header
316 ../archive_x
316 ../archive_x
317 ../archive_x/.hg_archival.txt
317 ../archive_x/.hg_archival.txt
318 ../archive_x/.hgsub
318 ../archive_x/.hgsub
319 ../archive_x/.hgsubstate
319 ../archive_x/.hgsubstate
320 ../archive_x/a
320 ../archive_x/a
321 ../archive_x/s
321 ../archive_x/s
322 ../archive_x/s/g
322 ../archive_x/s/g
323
323
324 create nested repo
324 create nested repo
325
325
326 $ cd ..
326 $ cd ..
327 $ hg init outer
327 $ hg init outer
328 $ cd outer
328 $ cd outer
329 $ echo b>b
329 $ echo b>b
330 $ hg add b
330 $ hg add b
331 $ hg commit -m b
331 $ hg commit -m b
332
332
333 $ hg clone ../t inner 2> /dev/null
333 $ hg clone ../t inner 2> /dev/null
334 updating to branch default
334 updating to branch default
335 cloning subrepo s from $TESTTMP/gitroot
335 cloning subrepo s from $TESTTMP/gitroot
336 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
336 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
337 $ echo inner = inner > .hgsub
337 $ echo inner = inner > .hgsub
338 $ hg add .hgsub
338 $ hg add .hgsub
339 $ hg commit -m 'nested sub'
339 $ hg commit -m 'nested sub'
340
340
341 nested commit
341 nested commit
342
342
343 $ echo ffff >> inner/s/f
343 $ echo ffff >> inner/s/f
344 $ hg status --subrepos
344 $ hg status --subrepos
345 M inner/s/f
345 M inner/s/f
346 $ hg commit --subrepos -m nested
346 $ hg commit --subrepos -m nested
347 committing subrepository inner
347 committing subrepository inner
348 committing subrepository inner/s (glob)
348 committing subrepository inner/s (glob)
349
349
350 nested archive
350 nested archive
351
351
352 $ hg archive --subrepos ../narchive
352 $ hg archive --subrepos ../narchive
353 $ ls ../narchive/inner/s | grep -v pax_global_header
353 $ ls ../narchive/inner/s | grep -v pax_global_header
354 f
354 f
355 g
355 g
356
356
357 relative source expansion
357 relative source expansion
358
358
359 $ cd ..
359 $ cd ..
360 $ mkdir d
360 $ mkdir d
361 $ hg clone t d/t 2> /dev/null
361 $ hg clone t d/t 2> /dev/null
362 updating to branch default
362 updating to branch default
363 cloning subrepo s from $TESTTMP/gitroot
363 cloning subrepo s from $TESTTMP/gitroot
364 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
364 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
365
365
366 Don't crash if the subrepo is missing
366 Don't crash if the subrepo is missing
367
367
368 $ hg clone t missing -q
368 $ hg clone t missing -q
369 $ cd missing
369 $ cd missing
370 $ rm -rf s
370 $ rm -rf s
371 $ hg status -S
371 $ hg status -S
372 $ hg sum | grep commit
372 $ hg sum | grep commit
373 commit: 1 subrepos
373 commit: 1 subrepos
374 $ hg push -q
374 $ hg push -q
375 abort: subrepo s is missing (in subrepo s)
375 abort: subrepo s is missing (in subrepo s)
376 [255]
376 [255]
377 $ hg commit --subrepos -qm missing
377 $ hg commit --subrepos -qm missing
378 abort: subrepo s is missing (in subrepo s)
378 abort: subrepo s is missing (in subrepo s)
379 [255]
379 [255]
380 $ hg update -C 2> /dev/null
380 $ hg update -C 2> /dev/null
381 cloning subrepo s from $TESTTMP/gitroot
381 cloning subrepo s from $TESTTMP/gitroot
382 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
382 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
383 $ hg sum | grep commit
383 $ hg sum | grep commit
384 commit: (clean)
384 commit: (clean)
385
385
386 Don't crash if the .hgsubstate entry is missing
386 Don't crash if the .hgsubstate entry is missing
387
387
388 $ hg update 1 -q
388 $ hg update 1 -q
389 $ hg rm .hgsubstate
389 $ hg rm .hgsubstate
390 $ hg commit .hgsubstate -m 'no substate'
390 $ hg commit .hgsubstate -m 'no substate'
391 nothing changed
391 nothing changed
392 [1]
392 [1]
393 $ hg tag -l nosubstate
393 $ hg tag -l nosubstate
394 $ hg manifest
394 $ hg manifest
395 .hgsub
395 .hgsub
396 .hgsubstate
396 .hgsubstate
397 a
397 a
398
398
399 $ hg status -S
399 $ hg status -S
400 R .hgsubstate
400 R .hgsubstate
401 $ hg sum | grep commit
401 $ hg sum | grep commit
402 commit: 1 removed, 1 subrepos (new branch head)
402 commit: 1 removed, 1 subrepos (new branch head)
403
403
404 $ hg commit -m 'restore substate'
404 $ hg commit -m 'restore substate'
405 nothing changed
405 nothing changed
406 [1]
406 [1]
407 $ hg manifest
407 $ hg manifest
408 .hgsub
408 .hgsub
409 .hgsubstate
409 .hgsubstate
410 a
410 a
411 $ hg sum | grep commit
411 $ hg sum | grep commit
412 commit: 1 removed, 1 subrepos (new branch head)
412 commit: 1 removed, 1 subrepos (new branch head)
413
413
414 $ hg update -qC nosubstate
414 $ hg update -qC nosubstate
415 $ ls s
415 $ ls s
416 g
416 g
417
417
418 issue3109: false positives in git diff-index
418 issue3109: false positives in git diff-index
419
419
420 $ hg update -q
420 $ hg update -q
421 $ touch -t 200001010000 s/g
421 $ touch -t 200001010000 s/g
422 $ hg status --subrepos
422 $ hg status --subrepos
423 $ touch -t 200001010000 s/g
423 $ touch -t 200001010000 s/g
424 $ hg sum | grep commit
424 $ hg sum | grep commit
425 commit: (clean)
425 commit: (clean)
426
426
427 Check hg update --clean
427 Check hg update --clean
428 $ cd $TESTTMP/ta
428 $ cd $TESTTMP/ta
429 $ echo > s/g
429 $ echo > s/g
430 $ cd s
430 $ cd s
431 $ echo c1 > f1
431 $ echo c1 > f1
432 $ echo c1 > f2
432 $ echo c1 > f2
433 $ git add f1
433 $ git add f1
434 $ cd ..
434 $ cd ..
435 $ hg status -S
435 $ hg status -S
436 M s/g
436 M s/g
437 A s/f1
437 A s/f1
438 ? s/f2
438 ? s/f2
439 $ ls s
439 $ ls s
440 f
440 f
441 f1
441 f1
442 f2
442 f2
443 g
443 g
444 $ hg update --clean
444 $ hg update --clean
445 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
445 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
446 $ hg status -S
446 $ hg status -S
447 ? s/f1
447 ? s/f1
448 ? s/f2
448 ? s/f2
449 $ ls s
449 $ ls s
450 f
450 f
451 f1
451 f1
452 f2
452 f2
453 g
453 g
454
454
455 Sticky subrepositories, no changes
455 Sticky subrepositories, no changes
456 $ cd $TESTTMP/ta
456 $ cd $TESTTMP/ta
457 $ hg id -n
457 $ hg id -n
458 7
458 7
459 $ cd s
459 $ cd s
460 $ git rev-parse HEAD
460 $ git rev-parse HEAD
461 32a343883b74769118bb1d3b4b1fbf9156f4dddc
461 32a343883b74769118bb1d3b4b1fbf9156f4dddc
462 $ cd ..
462 $ cd ..
463 $ hg update 1 > /dev/null 2>&1
463 $ hg update 1 > /dev/null 2>&1
464 $ hg id -n
464 $ hg id -n
465 1
465 1
466 $ cd s
466 $ cd s
467 $ git rev-parse HEAD
467 $ git rev-parse HEAD
468 da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
468 da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
469 $ cd ..
469 $ cd ..
470
470
471 Sticky subrepositories, file changes
471 Sticky subrepositories, file changes
472 $ touch s/f1
472 $ touch s/f1
473 $ cd s
473 $ cd s
474 $ git add f1
474 $ git add f1
475 $ cd ..
475 $ cd ..
476 $ hg id -n
476 $ hg id -n
477 1+
477 1+
478 $ cd s
478 $ cd s
479 $ git rev-parse HEAD
479 $ git rev-parse HEAD
480 da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
480 da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
481 $ cd ..
481 $ cd ..
482 $ hg update 4
482 $ hg update 4
483 subrepository s diverged (local revision: da5f5b1, remote revision: aa84837)
483 subrepository s diverged (local revision: da5f5b1, remote revision: aa84837)
484 (M)erge, keep (l)ocal or keep (r)emote? m
484 (M)erge, keep (l)ocal or keep (r)emote? m
485 subrepository sources for s differ
485 subrepository sources for s differ
486 use (l)ocal source (da5f5b1) or (r)emote source (aa84837)? l
486 use (l)ocal source (da5f5b1) or (r)emote source (aa84837)? l
487 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
487 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
488 $ hg id -n
488 $ hg id -n
489 4+
489 4+
490 $ cd s
490 $ cd s
491 $ git rev-parse HEAD
491 $ git rev-parse HEAD
492 da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
492 da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
493 $ cd ..
493 $ cd ..
494 $ hg update --clean tip > /dev/null 2>&1
494 $ hg update --clean tip > /dev/null 2>&1
495
495
496 Sticky subrepository, revision updates
496 Sticky subrepository, revision updates
497 $ hg id -n
497 $ hg id -n
498 7
498 7
499 $ cd s
499 $ cd s
500 $ git rev-parse HEAD
500 $ git rev-parse HEAD
501 32a343883b74769118bb1d3b4b1fbf9156f4dddc
501 32a343883b74769118bb1d3b4b1fbf9156f4dddc
502 $ cd ..
502 $ cd ..
503 $ cd s
503 $ cd s
504 $ git checkout aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
504 $ git checkout aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
505 Previous HEAD position was 32a3438... fff
505 Previous HEAD position was 32a3438... fff
506 HEAD is now at aa84837... f
506 HEAD is now at aa84837... f
507 $ cd ..
507 $ cd ..
508 $ hg update 1
508 $ hg update 1
509 subrepository s diverged (local revision: 32a3438, remote revision: da5f5b1)
509 subrepository s diverged (local revision: 32a3438, remote revision: da5f5b1)
510 (M)erge, keep (l)ocal or keep (r)emote? m
510 (M)erge, keep (l)ocal or keep (r)emote? m
511 subrepository sources for s differ (in checked out version)
511 subrepository sources for s differ (in checked out version)
512 use (l)ocal source (32a3438) or (r)emote source (da5f5b1)? l
512 use (l)ocal source (32a3438) or (r)emote source (da5f5b1)? l
513 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
514 $ hg id -n
514 $ hg id -n
515 1+
515 1+
516 $ cd s
516 $ cd s
517 $ git rev-parse HEAD
517 $ git rev-parse HEAD
518 aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
518 aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
519 $ cd ..
519 $ cd ..
520
520
521 Sticky subrepository, file changes and revision updates
521 Sticky subrepository, file changes and revision updates
522 $ touch s/f1
522 $ touch s/f1
523 $ cd s
523 $ cd s
524 $ git add f1
524 $ git add f1
525 $ git rev-parse HEAD
525 $ git rev-parse HEAD
526 aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
526 aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
527 $ cd ..
527 $ cd ..
528 $ hg id -n
528 $ hg id -n
529 1+
529 1+
530 $ hg update 7
530 $ hg update 7
531 subrepository s diverged (local revision: 32a3438, remote revision: 32a3438)
531 subrepository s diverged (local revision: 32a3438, remote revision: 32a3438)
532 (M)erge, keep (l)ocal or keep (r)emote? m
532 (M)erge, keep (l)ocal or keep (r)emote? m
533 subrepository sources for s differ
533 subrepository sources for s differ
534 use (l)ocal source (32a3438) or (r)emote source (32a3438)? l
534 use (l)ocal source (32a3438) or (r)emote source (32a3438)? l
535 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
535 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
536 $ hg id -n
536 $ hg id -n
537 7+
537 7+
538 $ cd s
538 $ cd s
539 $ git rev-parse HEAD
539 $ git rev-parse HEAD
540 aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
540 aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
541 $ cd ..
541 $ cd ..
542
542
543 Sticky repository, update --clean
543 Sticky repository, update --clean
544 $ hg update --clean tip 2>/dev/null
544 $ hg update --clean tip 2>/dev/null
545 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
545 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
546 $ hg id -n
546 $ hg id -n
547 7
547 7
548 $ cd s
548 $ cd s
549 $ git rev-parse HEAD
549 $ git rev-parse HEAD
550 32a343883b74769118bb1d3b4b1fbf9156f4dddc
550 32a343883b74769118bb1d3b4b1fbf9156f4dddc
551 $ cd ..
551 $ cd ..
552
552
553 Test subrepo already at intended revision:
553 Test subrepo already at intended revision:
554 $ cd s
554 $ cd s
555 $ git checkout 32a343883b74769118bb1d3b4b1fbf9156f4dddc
555 $ git checkout 32a343883b74769118bb1d3b4b1fbf9156f4dddc
556 HEAD is now at 32a3438... fff
556 HEAD is now at 32a3438... fff
557 $ cd ..
557 $ cd ..
558 $ hg update 1
558 $ hg update 1
559 Previous HEAD position was 32a3438... fff
559 Previous HEAD position was 32a3438... fff
560 HEAD is now at da5f5b1... g
560 HEAD is now at da5f5b1... g
561 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
561 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
562 $ hg id -n
562 $ hg id -n
563 1
563 1
564 $ cd s
564 $ cd s
565 $ git rev-parse HEAD
565 $ git rev-parse HEAD
566 da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
566 da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
567 $ cd ..
567 $ cd ..
568
568
569 Test forgetting files, not implemented in git subrepo, used to
569 Test forgetting files, not implemented in git subrepo, used to
570 traceback
570 traceback
571 #if no-windows
571 #if no-windows
572 $ hg forget 'notafile*'
572 $ hg forget 'notafile*'
573 notafile*: No such file or directory
573 notafile*: No such file or directory
574 [1]
574 [1]
575 #else
575 #else
576 $ hg forget 'notafile'
576 $ hg forget 'notafile'
577 notafile: * (glob)
577 notafile: * (glob)
578 [1]
578 [1]
579 #endif
579 #endif
580
580
581 $ cd ..
581 $ cd ..
582
582
583 Test sanitizing ".hg/hgrc" in subrepo
583 Test sanitizing ".hg/hgrc" in subrepo
584
584
585 $ cd t
585 $ cd t
586 $ hg tip -q
586 $ hg tip -q
587 7:af6d2edbb0d3
587 7:af6d2edbb0d3
588 $ hg update -q -C af6d2edbb0d3
588 $ hg update -q -C af6d2edbb0d3
589 $ cd s
589 $ cd s
590 $ git checkout -q -b sanitize-test
590 $ git checkout -q -b sanitize-test
591 $ mkdir .hg
591 $ mkdir .hg
592 $ echo '.hg/hgrc in git repo' > .hg/hgrc
592 $ echo '.hg/hgrc in git repo' > .hg/hgrc
593 $ mkdir -p sub/.hg
593 $ mkdir -p sub/.hg
594 $ echo 'sub/.hg/hgrc in git repo' > sub/.hg/hgrc
594 $ echo 'sub/.hg/hgrc in git repo' > sub/.hg/hgrc
595 $ git add .hg sub
595 $ git add .hg sub
596 $ git commit -qm 'add .hg/hgrc to be sanitized at hg update'
596 $ git commit -qm 'add .hg/hgrc to be sanitized at hg update'
597 $ git push -q origin sanitize-test
597 $ git push -q origin sanitize-test
598 $ cd ..
598 $ cd ..
599 $ grep ' s$' .hgsubstate
599 $ grep ' s$' .hgsubstate
600 32a343883b74769118bb1d3b4b1fbf9156f4dddc s
600 32a343883b74769118bb1d3b4b1fbf9156f4dddc s
601 $ hg commit -qm 'commit with git revision including .hg/hgrc'
601 $ hg commit -qm 'commit with git revision including .hg/hgrc'
602 $ hg parents -q
602 $ hg parents -q
603 8:3473d20bddcf
603 8:3473d20bddcf
604 $ grep ' s$' .hgsubstate
604 $ grep ' s$' .hgsubstate
605 c4069473b459cf27fd4d7c2f50c4346b4e936599 s
605 c4069473b459cf27fd4d7c2f50c4346b4e936599 s
606 $ cd ..
606 $ cd ..
607
607
608 $ hg -R tc pull -q
608 $ hg -R tc pull -q
609 $ hg -R tc update -q -C 3473d20bddcf 2>&1 | sort
609 $ hg -R tc update -q -C 3473d20bddcf 2>&1 | sort
610 warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/.hg' (glob)
610 warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/.hg' (glob)
611 warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/sub/.hg' (glob)
611 warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/sub/.hg' (glob)
612 $ cd tc
612 $ cd tc
613 $ hg parents -q
613 $ hg parents -q
614 8:3473d20bddcf
614 8:3473d20bddcf
615 $ grep ' s$' .hgsubstate
615 $ grep ' s$' .hgsubstate
616 c4069473b459cf27fd4d7c2f50c4346b4e936599 s
616 c4069473b459cf27fd4d7c2f50c4346b4e936599 s
617 $ test -f s/.hg/hgrc
617 $ test -f s/.hg/hgrc
618 [1]
618 [1]
619 $ test -f s/sub/.hg/hgrc
619 $ test -f s/sub/.hg/hgrc
620 [1]
620 [1]
621 $ cd ..
621 $ cd ..
622
622
623 additional test for "git merge --ff" route:
623 additional test for "git merge --ff" route:
624
624
625 $ cd t
625 $ cd t
626 $ hg tip -q
626 $ hg tip -q
627 8:3473d20bddcf
627 8:3473d20bddcf
628 $ hg update -q -C af6d2edbb0d3
628 $ hg update -q -C af6d2edbb0d3
629 $ cd s
629 $ cd s
630 $ git checkout -q testing
630 $ git checkout -q testing
631 $ mkdir .hg
631 $ mkdir .hg
632 $ echo '.hg/hgrc in git repo' > .hg/hgrc
632 $ echo '.hg/hgrc in git repo' > .hg/hgrc
633 $ mkdir -p sub/.hg
633 $ mkdir -p sub/.hg
634 $ echo 'sub/.hg/hgrc in git repo' > sub/.hg/hgrc
634 $ echo 'sub/.hg/hgrc in git repo' > sub/.hg/hgrc
635 $ git add .hg sub
635 $ git add .hg sub
636 $ git commit -qm 'add .hg/hgrc to be sanitized at hg update (git merge --ff)'
636 $ git commit -qm 'add .hg/hgrc to be sanitized at hg update (git merge --ff)'
637 $ git push -q origin testing
637 $ git push -q origin testing
638 $ cd ..
638 $ cd ..
639 $ grep ' s$' .hgsubstate
639 $ grep ' s$' .hgsubstate
640 32a343883b74769118bb1d3b4b1fbf9156f4dddc s
640 32a343883b74769118bb1d3b4b1fbf9156f4dddc s
641 $ hg commit -qm 'commit with git revision including .hg/hgrc'
641 $ hg commit -qm 'commit with git revision including .hg/hgrc'
642 $ hg parents -q
642 $ hg parents -q
643 9:ed23f7fe024e
643 9:ed23f7fe024e
644 $ grep ' s$' .hgsubstate
644 $ grep ' s$' .hgsubstate
645 f262643c1077219fbd3858d54e78ef050ef84fbf s
645 f262643c1077219fbd3858d54e78ef050ef84fbf s
646 $ cd ..
646 $ cd ..
647
647
648 $ cd tc
648 $ cd tc
649 $ hg update -q -C af6d2edbb0d3
649 $ hg update -q -C af6d2edbb0d3
650 $ test -f s/.hg/hgrc
650 $ test -f s/.hg/hgrc
651 [1]
651 [1]
652 $ test -f s/sub/.hg/hgrc
652 $ test -f s/sub/.hg/hgrc
653 [1]
653 [1]
654 $ cd ..
654 $ cd ..
655 $ hg -R tc pull -q
655 $ hg -R tc pull -q
656 $ hg -R tc update -q -C ed23f7fe024e 2>&1 | sort
656 $ hg -R tc update -q -C ed23f7fe024e 2>&1 | sort
657 warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/.hg' (glob)
657 warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/.hg' (glob)
658 warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/sub/.hg' (glob)
658 warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/sub/.hg' (glob)
659 $ cd tc
659 $ cd tc
660 $ hg parents -q
660 $ hg parents -q
661 9:ed23f7fe024e
661 9:ed23f7fe024e
662 $ grep ' s$' .hgsubstate
662 $ grep ' s$' .hgsubstate
663 f262643c1077219fbd3858d54e78ef050ef84fbf s
663 f262643c1077219fbd3858d54e78ef050ef84fbf s
664 $ test -f s/.hg/hgrc
664 $ test -f s/.hg/hgrc
665 [1]
665 [1]
666 $ test -f s/sub/.hg/hgrc
666 $ test -f s/sub/.hg/hgrc
667 [1]
667 [1]
668
668
669 Test that sanitizing is omitted in meta data area:
669 Test that sanitizing is omitted in meta data area:
670
670
671 $ mkdir s/.git/.hg
671 $ mkdir s/.git/.hg
672 $ echo '.hg/hgrc in git metadata area' > s/.git/.hg/hgrc
672 $ echo '.hg/hgrc in git metadata area' > s/.git/.hg/hgrc
673 $ hg update -q -C af6d2edbb0d3
673 $ hg update -q -C af6d2edbb0d3
674 checking out detached HEAD in subrepo s
674 checking out detached HEAD in subrepo s
675 check out a git branch if you intend to make changes
675 check out a git branch if you intend to make changes
676
676
677 check differences made by most recent change
677 check differences made by most recent change
678 $ cd s
678 $ cd s
679 $ cat > foobar << EOF
679 $ cat > foobar << EOF
680 > woopwoop
680 > woopwoop
681 >
681 >
682 > foo
682 > foo
683 > bar
683 > bar
684 > EOF
684 > EOF
685 $ git add foobar
685 $ git add foobar
686 $ cd ..
686 $ cd ..
687
687
688 $ hg diff --subrepos
688 $ hg diff --subrepos
689 diff --git a/s/foobar b/s/foobar
689 diff --git a/s/foobar b/s/foobar
690 new file mode 100644
690 new file mode 100644
691 index 0000000..8a5a5e2
691 index 0000000..8a5a5e2
692 --- /dev/null
692 --- /dev/null
693 +++ b/s/foobar
693 +++ b/s/foobar
694 @@ -0,0 +1,4 @@
694 @@ -0,0 +1,4 @@
695 +woopwoop
695 +woopwoop
696 +
696 +
697 +foo
697 +foo
698 +bar (no-eol)
698 +bar (no-eol)
699
699
700 $ hg commit --subrepos -m "Added foobar"
700 $ hg commit --subrepos -m "Added foobar"
701 committing subrepository s
701 committing subrepository s
702 created new head
702 created new head
703
703
704 $ hg diff -c . --subrepos --nodates
704 $ hg diff -c . --subrepos --nodates
705 diff -r af6d2edbb0d3 -r 255ee8cf690e .hgsubstate
705 diff -r af6d2edbb0d3 -r 255ee8cf690e .hgsubstate
706 --- a/.hgsubstate
706 --- a/.hgsubstate
707 +++ b/.hgsubstate
707 +++ b/.hgsubstate
708 @@ -1,1 +1,1 @@
708 @@ -1,1 +1,1 @@
709 -32a343883b74769118bb1d3b4b1fbf9156f4dddc s
709 -32a343883b74769118bb1d3b4b1fbf9156f4dddc s
710 +fd4dbf828a5b2fcd36b2bcf21ea773820970d129 s
710 +fd4dbf828a5b2fcd36b2bcf21ea773820970d129 s
711 diff --git a/s/foobar b/s/foobar
711 diff --git a/s/foobar b/s/foobar
712 new file mode 100644
712 new file mode 100644
713 index 0000000..8a5a5e2
713 index 0000000..8a5a5e2
714 --- /dev/null
714 --- /dev/null
715 +++ b/s/foobar
715 +++ b/s/foobar
716 @@ -0,0 +1,4 @@
716 @@ -0,0 +1,4 @@
717 +woopwoop
717 +woopwoop
718 +
718 +
719 +foo
719 +foo
720 +bar (no-eol)
720 +bar (no-eol)
721
721
722 check output when only diffing the subrepository
722 check output when only diffing the subrepository
723 $ hg diff -c . --subrepos s
723 $ hg diff -c . --subrepos s
724 diff --git a/s/foobar b/s/foobar
724 diff --git a/s/foobar b/s/foobar
725 new file mode 100644
725 new file mode 100644
726 index 0000000..8a5a5e2
726 index 0000000..8a5a5e2
727 --- /dev/null
727 --- /dev/null
728 +++ b/s/foobar
728 +++ b/s/foobar
729 @@ -0,0 +1,4 @@
729 @@ -0,0 +1,4 @@
730 +woopwoop
730 +woopwoop
731 +
731 +
732 +foo
732 +foo
733 +bar (no-eol)
733 +bar (no-eol)
734
734
735 check output when diffing something else
735 check output when diffing something else
736 $ hg diff -c . --subrepos .hgsubstate --nodates
736 $ hg diff -c . --subrepos .hgsubstate --nodates
737 diff -r af6d2edbb0d3 -r 255ee8cf690e .hgsubstate
737 diff -r af6d2edbb0d3 -r 255ee8cf690e .hgsubstate
738 --- a/.hgsubstate
738 --- a/.hgsubstate
739 +++ b/.hgsubstate
739 +++ b/.hgsubstate
740 @@ -1,1 +1,1 @@
740 @@ -1,1 +1,1 @@
741 -32a343883b74769118bb1d3b4b1fbf9156f4dddc s
741 -32a343883b74769118bb1d3b4b1fbf9156f4dddc s
742 +fd4dbf828a5b2fcd36b2bcf21ea773820970d129 s
742 +fd4dbf828a5b2fcd36b2bcf21ea773820970d129 s
743
743
744 add new changes, including whitespace
744 add new changes, including whitespace
745 $ cd s
745 $ cd s
746 $ cat > foobar << EOF
746 $ cat > foobar << EOF
747 > woop woop
747 > woop woop
748 >
748 >
749 > foo
749 > foo
750 > bar
750 > bar
751 > EOF
751 > EOF
752 $ echo foo > barfoo
752 $ echo foo > barfoo
753 $ git add barfoo
753 $ git add barfoo
754 $ cd ..
754 $ cd ..
755
755
756 $ hg diff --subrepos --ignore-all-space
756 $ hg diff --subrepos --ignore-all-space
757 diff --git a/s/barfoo b/s/barfoo
757 diff --git a/s/barfoo b/s/barfoo
758 new file mode 100644
758 new file mode 100644
759 index 0000000..257cc56
759 index 0000000..257cc56
760 --- /dev/null
760 --- /dev/null
761 +++ b/s/barfoo
761 +++ b/s/barfoo
762 @@ -0,0 +1 @@
762 @@ -0,0 +1 @@
763 +foo (no-eol)
763 +foo (no-eol)
764 $ hg diff --subrepos s/foobar
764 $ hg diff --subrepos s/foobar
765 diff --git a/s/foobar b/s/foobar
765 diff --git a/s/foobar b/s/foobar
766 index 8a5a5e2..bd5812a 100644
766 index 8a5a5e2..bd5812a 100644
767 --- a/s/foobar
767 --- a/s/foobar
768 +++ b/s/foobar
768 +++ b/s/foobar
769 @@ -1,4 +1,4 @@
769 @@ -1,4 +1,4 @@
770 -woopwoop
770 -woopwoop
771 +woop woop
771 +woop woop
772
772
773 foo
773 foo
774 bar (no-eol)
774 bar (no-eol)
775
775
776 execute a diffstat
776 execute a diffstat
777 the output contains a regex, because git 1.7.10 and 1.7.11
777 the output contains a regex, because git 1.7.10 and 1.7.11
778 change the amount of whitespace
778 change the amount of whitespace
779 $ hg diff --subrepos --stat
779 $ hg diff --subrepos --stat
780 \s*barfoo |\s*1 + (re)
780 \s*barfoo |\s*1 + (re)
781 \s*foobar |\s*2 +- (re)
781 \s*foobar |\s*2 +- (re)
782 2 files changed, 2 insertions\(\+\), 1 deletions?\(-\) \(no-eol\) (re)
782 2 files changed, 2 insertions\(\+\), 1 deletions?\(-\) \(no-eol\) (re)
783
783
784 ensure adding include/exclude ignores the subrepo
784 ensure adding include/exclude ignores the subrepo
785 $ hg diff --subrepos -I s/foobar
785 $ hg diff --subrepos -I s/foobar
786 $ hg diff --subrepos -X s/foobar
786 $ hg diff --subrepos -X s/foobar
787
787
788 revert the subrepository
788 revert the subrepository
789 $ hg revert --all
789 $ hg revert --all
790 reverting subrepo ../gitroot (glob)
790 reverting subrepo ../gitroot
791
791
792 $ hg status --subrepos
792 $ hg status --subrepos
793 ? s/barfoo
793 ? s/barfoo
794 ? s/foobar.orig
794 ? s/foobar.orig
795
795
796 $ mv s/foobar.orig s/foobar
796 $ mv s/foobar.orig s/foobar
797
797
798 $ hg revert --no-backup s
798 $ hg revert --no-backup s
799 reverting subrepo ../gitroot (glob)
799 reverting subrepo ../gitroot
800
800
801 $ hg status --subrepos
801 $ hg status --subrepos
802 ? s/barfoo
802 ? s/barfoo
803
803
804 $ cd ..
804 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now