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