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