Merge branch 'jc/ci-upload-artifact-and-linux32'
[git/gitster.git] / t / t9809-git-p4-client-view.sh
blobf33fdea889edc339267ff4bb7bf7d94809897952
1 #!/bin/sh
3 test_description='git p4 client view'
5 TEST_PASSES_SANITIZE_LEAK=true
6 . ./lib-git-p4.sh
8 test_expect_success 'start p4d' '
9 start_p4d
13 # Verify these files exist, exactly. Caller creates
14 # a list of files in file "files".
16 check_files_exist() {
17 ok=0 &&
18 num=$# &&
19 for arg ; do
20 test_path_is_file "$arg" &&
21 ok=$(($ok + 1))
22 done &&
23 test $ok -eq $num &&
24 test_line_count = $num files
28 # Sync up the p4 client, make sure the given files (and only
29 # those) exist.
31 client_verify() {
33 cd "$cli" &&
34 p4 sync &&
35 find . -type f ! -name files >files &&
36 check_files_exist "$@"
41 # Make sure the named files, exactly, exist.
43 git_verify() {
45 cd "$git" &&
46 git ls-files >files &&
47 check_files_exist "$@"
51 # //depot
52 # - dir1
53 # - file11
54 # - file12
55 # - dir2
56 # - file21
57 # - file22
58 init_depot() {
59 for d in 1 2 ; do
60 mkdir -p dir$d &&
61 for f in 1 2 ; do
62 echo dir$d/file$d$f >dir$d/file$d$f &&
63 p4 add dir$d/file$d$f &&
64 p4 submit -d "dir$d/file$d$f"
65 done
66 done &&
67 find . -type f ! -name files >files &&
68 check_files_exist dir1/file11 dir1/file12 \
69 dir2/file21 dir2/file22
72 test_expect_success 'init depot' '
74 cd "$cli" &&
75 init_depot
79 # double % for printf
80 test_expect_success 'view wildcard %%n' '
81 client_view "//depot/%%%%1/sub/... //client/sub/%%%%1/..." &&
82 test_when_finished cleanup_git &&
83 git p4 clone --use-client-spec --dest="$git" //depot
86 test_expect_success 'view wildcard *' '
87 client_view "//depot/*/bar/... //client/*/bar/..." &&
88 test_when_finished cleanup_git &&
89 git p4 clone --use-client-spec --dest="$git" //depot
92 test_expect_success 'wildcard ... in the middle' '
93 client_view "//depot/.../file11 //client/.../file11" &&
94 test_when_finished cleanup_git &&
95 git p4 clone --use-client-spec --dest="$git" //depot
98 test_expect_success 'wildcard ... in the middle and at the end' '
99 client_view "//depot/.../a/... //client/.../a/..." &&
100 test_when_finished cleanup_git &&
101 git p4 clone --use-client-spec --dest="$git" //depot
104 test_expect_success 'basic map' '
105 client_view "//depot/dir1/... //client/cli1/..." &&
106 files="cli1/file11 cli1/file12" &&
107 client_verify $files &&
108 test_when_finished cleanup_git &&
109 git p4 clone --use-client-spec --dest="$git" //depot &&
110 git_verify $files
113 test_expect_success 'client view with no mappings' '
114 client_view &&
115 client_verify &&
116 test_when_finished cleanup_git &&
117 git p4 clone --use-client-spec --dest="$git" //depot &&
118 git_verify
121 test_expect_success 'single file map' '
122 client_view "//depot/dir1/file11 //client/file11" &&
123 files="file11" &&
124 client_verify $files &&
125 test_when_finished cleanup_git &&
126 git p4 clone --use-client-spec --dest="$git" //depot &&
127 git_verify $files
130 test_expect_success 'later mapping takes precedence (entire repo)' '
131 client_view "//depot/dir1/... //client/cli1/..." \
132 "//depot/... //client/cli2/..." &&
133 files="cli2/dir1/file11 cli2/dir1/file12
134 cli2/dir2/file21 cli2/dir2/file22" &&
135 client_verify $files &&
136 test_when_finished cleanup_git &&
137 git p4 clone --use-client-spec --dest="$git" //depot &&
138 git_verify $files
141 test_expect_success 'later mapping takes precedence (partial repo)' '
142 client_view "//depot/dir1/... //client/..." \
143 "//depot/dir2/... //client/..." &&
144 files="file21 file22" &&
145 client_verify $files &&
146 test_when_finished cleanup_git &&
147 git p4 clone --use-client-spec --dest="$git" //depot &&
148 git_verify $files
151 # Reading the view backwards,
152 # dir2 goes to cli12
153 # dir1 cannot go to cli12 since it was filled by dir2
154 # dir1 also does not go to cli3, since the second rule
155 # noticed that it matched, but was already filled
156 test_expect_success 'depot path matching rejected client path' '
157 client_view "//depot/dir1/... //client/cli3/..." \
158 "//depot/dir1/... //client/cli12/..." \
159 "//depot/dir2/... //client/cli12/..." &&
160 files="cli12/file21 cli12/file22" &&
161 client_verify $files &&
162 test_when_finished cleanup_git &&
163 git p4 clone --use-client-spec --dest="$git" //depot &&
164 git_verify $files
167 # since both have the same //client/..., the exclusion
168 # rule keeps everything out
169 test_expect_success 'exclusion wildcard, client rhs same (odd)' '
170 client_view "//depot/... //client/..." \
171 "-//depot/dir2/... //client/..." &&
172 client_verify &&
173 test_when_finished cleanup_git &&
174 git p4 clone --use-client-spec --dest="$git" //depot &&
175 git_verify
178 test_expect_success 'exclusion wildcard, client rhs different (normal)' '
179 client_view "//depot/... //client/..." \
180 "-//depot/dir2/... //client/dir2/..." &&
181 files="dir1/file11 dir1/file12" &&
182 client_verify $files &&
183 test_when_finished cleanup_git &&
184 git p4 clone --use-client-spec --dest="$git" //depot &&
185 git_verify $files
188 test_expect_success 'exclusion single file' '
189 client_view "//depot/... //client/..." \
190 "-//depot/dir2/file22 //client/file22" &&
191 files="dir1/file11 dir1/file12 dir2/file21" &&
192 client_verify $files &&
193 test_when_finished cleanup_git &&
194 git p4 clone --use-client-spec --dest="$git" //depot &&
195 git_verify $files
198 test_expect_success 'overlay wildcard' '
199 client_view "//depot/dir1/... //client/cli/..." \
200 "+//depot/dir2/... //client/cli/..." &&
201 files="cli/file11 cli/file12 cli/file21 cli/file22" &&
202 client_verify $files &&
203 test_when_finished cleanup_git &&
204 git p4 clone --use-client-spec --dest="$git" //depot &&
205 git_verify $files
208 test_expect_success 'overlay single file' '
209 client_view "//depot/dir1/... //client/cli/..." \
210 "+//depot/dir2/file21 //client/cli/file21" &&
211 files="cli/file11 cli/file12 cli/file21" &&
212 client_verify $files &&
213 test_when_finished cleanup_git &&
214 git p4 clone --use-client-spec --dest="$git" //depot &&
215 git_verify $files
218 test_expect_success 'exclusion with later inclusion' '
219 client_view "//depot/... //client/..." \
220 "-//depot/dir2/... //client/dir2/..." \
221 "//depot/dir2/... //client/dir2incl/..." &&
222 files="dir1/file11 dir1/file12 dir2incl/file21 dir2incl/file22" &&
223 client_verify $files &&
224 test_when_finished cleanup_git &&
225 git p4 clone --use-client-spec --dest="$git" //depot &&
226 git_verify $files
229 test_expect_success 'quotes on rhs only' '
230 client_view "//depot/dir1/... \"//client/cdir 1/...\"" &&
231 client_verify "cdir 1/file11" "cdir 1/file12" &&
232 test_when_finished cleanup_git &&
233 git p4 clone --use-client-spec --dest="$git" //depot &&
234 git_verify "cdir 1/file11" "cdir 1/file12"
238 # Submit tests
241 # clone sets variable
242 test_expect_success 'clone --use-client-spec sets useClientSpec' '
243 client_view "//depot/... //client/..." &&
244 test_when_finished cleanup_git &&
245 git p4 clone --use-client-spec --dest="$git" //depot &&
247 cd "$git" &&
248 git config --bool git-p4.useClientSpec >actual &&
249 echo true >true &&
250 test_cmp actual true
254 # clone just a subdir of the client spec
255 test_expect_success 'subdir clone' '
256 client_view "//depot/... //client/..." &&
257 files="dir1/file11 dir1/file12 dir2/file21 dir2/file22" &&
258 client_verify $files &&
259 test_when_finished cleanup_git &&
260 git p4 clone --use-client-spec --dest="$git" //depot/dir1 &&
261 git_verify dir1/file11 dir1/file12
265 # submit back, see what happens: five cases
267 test_expect_success 'subdir clone, submit modify' '
268 client_view "//depot/... //client/..." &&
269 test_when_finished cleanup_git &&
270 git p4 clone --use-client-spec --dest="$git" //depot/dir1 &&
272 cd "$git" &&
273 git config git-p4.skipSubmitEdit true &&
274 echo line >>dir1/file12 &&
275 git add dir1/file12 &&
276 git commit -m dir1/file12 &&
277 git p4 submit
278 ) &&
280 cd "$cli" &&
281 test_path_is_file dir1/file12 &&
282 test_line_count = 2 dir1/file12
286 test_expect_success 'subdir clone, submit add' '
287 client_view "//depot/... //client/..." &&
288 test_when_finished cleanup_git &&
289 git p4 clone --use-client-spec --dest="$git" //depot/dir1 &&
291 cd "$git" &&
292 git config git-p4.skipSubmitEdit true &&
293 echo file13 >dir1/file13 &&
294 git add dir1/file13 &&
295 git commit -m dir1/file13 &&
296 git p4 submit
297 ) &&
299 cd "$cli" &&
300 test_path_is_file dir1/file13
304 test_expect_success 'subdir clone, submit delete' '
305 client_view "//depot/... //client/..." &&
306 test_when_finished cleanup_git &&
307 git p4 clone --use-client-spec --dest="$git" //depot/dir1 &&
309 cd "$git" &&
310 git config git-p4.skipSubmitEdit true &&
311 git rm dir1/file12 &&
312 git commit -m "delete dir1/file12" &&
313 git p4 submit
314 ) &&
316 cd "$cli" &&
317 test_path_is_missing dir1/file12
321 test_expect_success 'subdir clone, submit copy' '
322 client_view "//depot/... //client/..." &&
323 test_when_finished cleanup_git &&
324 git p4 clone --use-client-spec --dest="$git" //depot/dir1 &&
326 cd "$git" &&
327 git config git-p4.skipSubmitEdit true &&
328 git config git-p4.detectCopies true &&
329 cp dir1/file11 dir1/file11a &&
330 git add dir1/file11a &&
331 git commit -m "copy to dir1/file11a" &&
332 git p4 submit
333 ) &&
335 cd "$cli" &&
336 test_path_is_file dir1/file11a &&
337 ! is_cli_file_writeable dir1/file11a
341 test_expect_success 'subdir clone, submit rename' '
342 client_view "//depot/... //client/..." &&
343 test_when_finished cleanup_git &&
344 git p4 clone --use-client-spec --dest="$git" //depot/dir1 &&
346 cd "$git" &&
347 git config git-p4.skipSubmitEdit true &&
348 git config git-p4.detectRenames true &&
349 git mv dir1/file13 dir1/file13a &&
350 git commit -m "rename dir1/file13 to dir1/file13a" &&
351 git p4 submit
352 ) &&
354 cd "$cli" &&
355 test_path_is_missing dir1/file13 &&
356 test_path_is_file dir1/file13a &&
357 ! is_cli_file_writeable dir1/file13a
361 # see t9800 for the non-client-spec case, and the rest of the wildcard tests
362 test_expect_success 'wildcard files submit back to p4, client-spec case' '
363 client_view "//depot/... //client/..." &&
364 test_when_finished cleanup_git &&
365 git p4 clone --use-client-spec --dest="$git" //depot/dir1 &&
367 cd "$git" &&
368 echo git-wild-hash >dir1/git-wild#hash &&
369 if test_have_prereq !MINGW,!CYGWIN
370 then
371 echo git-wild-star >dir1/git-wild\*star
372 fi &&
373 echo git-wild-at >dir1/git-wild@at &&
374 echo git-wild-percent >dir1/git-wild%percent &&
375 git add dir1/git-wild* &&
376 git commit -m "add some wildcard filenames" &&
377 git config git-p4.skipSubmitEditCheck true &&
378 git p4 submit
379 ) &&
381 cd "$cli" &&
382 test_path_is_file dir1/git-wild#hash &&
383 if test_have_prereq !MINGW,!CYGWIN
384 then
385 test_path_is_file dir1/git-wild\*star
386 fi &&
387 test_path_is_file dir1/git-wild@at &&
388 test_path_is_file dir1/git-wild%percent
389 ) &&
391 # delete these carefully, cannot just do "p4 delete"
392 # on files with wildcards; but git-p4 knows how
393 cd "$git" &&
394 git rm dir1/git-wild* &&
395 git commit -m "clean up the wildcards" &&
396 git p4 submit
400 test_expect_success 'reinit depot' '
402 cd "$cli" &&
403 rm files &&
404 p4 delete */* &&
405 p4 submit -d "delete all files" &&
406 init_depot
411 # What happens when two files of the same name are overlaid together?
412 # The last-listed file should take preference.
414 # //depot
415 # - dir1
416 # - file11
417 # - file12
418 # - filecollide
419 # - dir2
420 # - file21
421 # - file22
422 # - filecollide
424 test_expect_success 'overlay collision setup' '
425 client_view "//depot/... //client/..." &&
427 cd "$cli" &&
428 p4 sync &&
429 echo dir1/filecollide >dir1/filecollide &&
430 p4 add dir1/filecollide &&
431 p4 submit -d dir1/filecollide &&
432 echo dir2/filecollide >dir2/filecollide &&
433 p4 add dir2/filecollide &&
434 p4 submit -d dir2/filecollide
438 test_expect_success 'overlay collision 1 to 2' '
439 client_view "//depot/dir1/... //client/..." \
440 "+//depot/dir2/... //client/..." &&
441 files="file11 file12 file21 file22 filecollide" &&
442 echo dir2/filecollide >actual &&
443 client_verify $files &&
444 test_cmp actual "$cli"/filecollide &&
445 test_when_finished cleanup_git &&
446 git p4 clone --use-client-spec --dest="$git" //depot &&
447 git_verify $files &&
448 test_cmp actual "$git"/filecollide
451 test_expect_failure 'overlay collision 2 to 1' '
452 client_view "//depot/dir2/... //client/..." \
453 "+//depot/dir1/... //client/..." &&
454 files="file11 file12 file21 file22 filecollide" &&
455 echo dir1/filecollide >actual &&
456 client_verify $files &&
457 test_cmp actual "$cli"/filecollide &&
458 test_when_finished cleanup_git &&
459 git p4 clone --use-client-spec --dest="$git" //depot &&
460 git_verify $files &&
461 test_cmp actual "$git"/filecollide
464 test_expect_success 'overlay collision delete 2' '
465 client_view "//depot/... //client/..." &&
467 cd "$cli" &&
468 p4 sync &&
469 p4 delete dir2/filecollide &&
470 p4 submit -d "remove dir2/filecollide"
474 # no filecollide, got deleted with dir2
475 test_expect_failure 'overlay collision 1 to 2, but 2 deleted' '
476 client_view "//depot/dir1/... //client/..." \
477 "+//depot/dir2/... //client/..." &&
478 files="file11 file12 file21 file22" &&
479 client_verify $files &&
480 test_when_finished cleanup_git &&
481 git p4 clone --use-client-spec --dest="$git" //depot &&
482 git_verify $files
485 test_expect_success 'overlay collision update 1' '
486 client_view "//depot/dir1/... //client/dir1/..." &&
488 cd "$cli" &&
489 p4 sync &&
490 p4 open dir1/filecollide &&
491 echo dir1/filecollide update >dir1/filecollide &&
492 p4 submit -d "update dir1/filecollide"
496 # still no filecollide, dir2 still wins with the deletion even though the
497 # change to dir1 is more recent
498 test_expect_failure 'overlay collision 1 to 2, but 2 deleted, then 1 updated' '
499 client_view "//depot/dir1/... //client/..." \
500 "+//depot/dir2/... //client/..." &&
501 files="file11 file12 file21 file22" &&
502 client_verify $files &&
503 test_when_finished cleanup_git &&
504 git p4 clone --use-client-spec --dest="$git" //depot &&
505 git_verify $files
508 test_expect_success 'overlay collision delete filecollides' '
509 client_view "//depot/... //client/..." &&
511 cd "$cli" &&
512 p4 sync &&
513 p4 delete dir1/filecollide dir2/filecollide &&
514 p4 submit -d "remove filecollides"
519 # Overlays as part of sync, rather than initial checkout:
520 # 1. add a file in dir1
521 # 2. sync to include it
522 # 3. add same file in dir2
523 # 4. sync, make sure content switches as dir2 has priority
524 # 5. add another file in dir1
525 # 6. sync
526 # 7. add/delete same file in dir2
527 # 8. sync, make sure it disappears, again dir2 wins
528 # 9. cleanup
530 # //depot
531 # - dir1
532 # - file11
533 # - file12
534 # - colA
535 # - colB
536 # - dir2
537 # - file21
538 # - file22
539 # - colA
540 # - colB
542 test_expect_success 'overlay sync: add colA in dir1' '
543 client_view "//depot/dir1/... //client/dir1/..." &&
545 cd "$cli" &&
546 p4 sync &&
547 echo dir1/colA >dir1/colA &&
548 p4 add dir1/colA &&
549 p4 submit -d dir1/colA
553 test_expect_success 'overlay sync: initial git checkout' '
554 client_view "//depot/dir1/... //client/..." \
555 "+//depot/dir2/... //client/..." &&
556 files="file11 file12 file21 file22 colA" &&
557 echo dir1/colA >actual &&
558 client_verify $files &&
559 test_cmp actual "$cli"/colA &&
560 git p4 clone --use-client-spec --dest="$git" //depot &&
561 git_verify $files &&
562 test_cmp actual "$git"/colA
565 test_expect_success 'overlay sync: add colA in dir2' '
566 client_view "//depot/dir2/... //client/dir2/..." &&
568 cd "$cli" &&
569 p4 sync &&
570 echo dir2/colA >dir2/colA &&
571 p4 add dir2/colA &&
572 p4 submit -d dir2/colA
576 test_expect_success 'overlay sync: colA content switch' '
577 client_view "//depot/dir1/... //client/..." \
578 "+//depot/dir2/... //client/..." &&
579 files="file11 file12 file21 file22 colA" &&
580 echo dir2/colA >actual &&
581 client_verify $files &&
582 test_cmp actual "$cli"/colA &&
584 cd "$git" &&
585 git p4 sync --use-client-spec &&
586 git merge --ff-only p4/master
587 ) &&
588 git_verify $files &&
589 test_cmp actual "$git"/colA
592 test_expect_success 'overlay sync: add colB in dir1' '
593 client_view "//depot/dir1/... //client/dir1/..." &&
595 cd "$cli" &&
596 p4 sync &&
597 echo dir1/colB >dir1/colB &&
598 p4 add dir1/colB &&
599 p4 submit -d dir1/colB
603 test_expect_success 'overlay sync: colB appears' '
604 client_view "//depot/dir1/... //client/..." \
605 "+//depot/dir2/... //client/..." &&
606 files="file11 file12 file21 file22 colA colB" &&
607 echo dir1/colB >actual &&
608 client_verify $files &&
609 test_cmp actual "$cli"/colB &&
611 cd "$git" &&
612 git p4 sync --use-client-spec &&
613 git merge --ff-only p4/master
614 ) &&
615 git_verify $files &&
616 test_cmp actual "$git"/colB
619 test_expect_success 'overlay sync: add/delete colB in dir2' '
620 client_view "//depot/dir2/... //client/dir2/..." &&
622 cd "$cli" &&
623 p4 sync &&
624 echo dir2/colB >dir2/colB &&
625 p4 add dir2/colB &&
626 p4 submit -d dir2/colB &&
627 p4 delete dir2/colB &&
628 p4 submit -d "delete dir2/colB"
632 test_expect_success 'overlay sync: colB disappears' '
633 client_view "//depot/dir1/... //client/..." \
634 "+//depot/dir2/... //client/..." &&
635 files="file11 file12 file21 file22 colA" &&
636 client_verify $files &&
637 test_when_finished cleanup_git &&
639 cd "$git" &&
640 git p4 sync --use-client-spec &&
641 git merge --ff-only p4/master
642 ) &&
643 git_verify $files
646 test_expect_success 'overlay sync: cleanup' '
647 client_view "//depot/... //client/..." &&
649 cd "$cli" &&
650 p4 sync &&
651 p4 delete dir1/colA dir2/colA dir1/colB &&
652 p4 submit -d "remove overlay sync files"
657 # Overlay tests again, but swapped so dir1 has priority.
658 # 1. add a file in dir1
659 # 2. sync to include it
660 # 3. add same file in dir2
661 # 4. sync, make sure content does not switch
662 # 5. add another file in dir1
663 # 6. sync
664 # 7. add/delete same file in dir2
665 # 8. sync, make sure it is still there
666 # 9. cleanup
668 # //depot
669 # - dir1
670 # - file11
671 # - file12
672 # - colA
673 # - colB
674 # - dir2
675 # - file21
676 # - file22
677 # - colA
678 # - colB
680 test_expect_success 'overlay sync swap: add colA in dir1' '
681 client_view "//depot/dir1/... //client/dir1/..." &&
683 cd "$cli" &&
684 p4 sync &&
685 echo dir1/colA >dir1/colA &&
686 p4 add dir1/colA &&
687 p4 submit -d dir1/colA
691 test_expect_success 'overlay sync swap: initial git checkout' '
692 client_view "//depot/dir2/... //client/..." \
693 "+//depot/dir1/... //client/..." &&
694 files="file11 file12 file21 file22 colA" &&
695 echo dir1/colA >actual &&
696 client_verify $files &&
697 test_cmp actual "$cli"/colA &&
698 git p4 clone --use-client-spec --dest="$git" //depot &&
699 git_verify $files &&
700 test_cmp actual "$git"/colA
703 test_expect_success 'overlay sync swap: add colA in dir2' '
704 client_view "//depot/dir2/... //client/dir2/..." &&
706 cd "$cli" &&
707 p4 sync &&
708 echo dir2/colA >dir2/colA &&
709 p4 add dir2/colA &&
710 p4 submit -d dir2/colA
714 test_expect_failure 'overlay sync swap: colA no content switch' '
715 client_view "//depot/dir2/... //client/..." \
716 "+//depot/dir1/... //client/..." &&
717 files="file11 file12 file21 file22 colA" &&
718 echo dir1/colA >actual &&
719 client_verify $files &&
720 test_cmp actual "$cli"/colA &&
722 cd "$git" &&
723 git p4 sync --use-client-spec &&
724 git merge --ff-only p4/master
725 ) &&
726 git_verify $files &&
727 test_cmp actual "$git"/colA
730 test_expect_success 'overlay sync swap: add colB in dir1' '
731 client_view "//depot/dir1/... //client/dir1/..." &&
733 cd "$cli" &&
734 p4 sync &&
735 echo dir1/colB >dir1/colB &&
736 p4 add dir1/colB &&
737 p4 submit -d dir1/colB
741 test_expect_success 'overlay sync swap: colB appears' '
742 client_view "//depot/dir2/... //client/..." \
743 "+//depot/dir1/... //client/..." &&
744 files="file11 file12 file21 file22 colA colB" &&
745 echo dir1/colB >actual &&
746 client_verify $files &&
747 test_cmp actual "$cli"/colB &&
749 cd "$git" &&
750 git p4 sync --use-client-spec &&
751 git merge --ff-only p4/master
752 ) &&
753 git_verify $files &&
754 test_cmp actual "$git"/colB
757 test_expect_success 'overlay sync swap: add/delete colB in dir2' '
758 client_view "//depot/dir2/... //client/dir2/..." &&
760 cd "$cli" &&
761 p4 sync &&
762 echo dir2/colB >dir2/colB &&
763 p4 add dir2/colB &&
764 p4 submit -d dir2/colB &&
765 p4 delete dir2/colB &&
766 p4 submit -d "delete dir2/colB"
770 test_expect_failure 'overlay sync swap: colB no change' '
771 client_view "//depot/dir2/... //client/..." \
772 "+//depot/dir1/... //client/..." &&
773 files="file11 file12 file21 file22 colA colB" &&
774 echo dir1/colB >actual &&
775 client_verify $files &&
776 test_cmp actual "$cli"/colB &&
777 test_when_finished cleanup_git &&
779 cd "$git" &&
780 git p4 sync --use-client-spec &&
781 git merge --ff-only p4/master
782 ) &&
783 git_verify $files &&
784 test_cmp actual "$cli"/colB
787 test_expect_success 'overlay sync swap: cleanup' '
788 client_view "//depot/... //client/..." &&
790 cd "$cli" &&
791 p4 sync &&
792 p4 delete dir1/colA dir2/colA dir1/colB &&
793 p4 submit -d "remove overlay sync files"
798 # Rename directories to test quoting in depot-side mappings
799 # //depot
800 # - "dir 1"
801 # - file11
802 # - file12
803 # - "dir 2"
804 # - file21
805 # - file22
807 test_expect_success 'rename files to introduce spaces' '
808 client_view "//depot/... //client/..." &&
809 client_verify dir1/file11 dir1/file12 \
810 dir2/file21 dir2/file22 &&
812 cd "$cli" &&
813 p4 open dir1/... &&
814 p4 move dir1/... "dir 1"/... &&
815 p4 open dir2/... &&
816 p4 move dir2/... "dir 2"/... &&
817 p4 submit -d "rename with spaces"
818 ) &&
819 client_verify "dir 1/file11" "dir 1/file12" \
820 "dir 2/file21" "dir 2/file22"
823 test_expect_success 'quotes on lhs only' '
824 client_view "\"//depot/dir 1/...\" //client/cdir1/..." &&
825 files="cdir1/file11 cdir1/file12" &&
826 client_verify $files &&
827 test_when_finished cleanup_git &&
828 git p4 clone --use-client-spec --dest="$git" //depot &&
829 client_verify $files
832 test_expect_success 'quotes on both sides' '
833 client_view "\"//depot/dir 1/...\" \"//client/cdir 1/...\"" &&
834 client_verify "cdir 1/file11" "cdir 1/file12" &&
835 test_when_finished cleanup_git &&
836 git p4 clone --use-client-spec --dest="$git" //depot &&
837 git_verify "cdir 1/file11" "cdir 1/file12"
840 test_done