3 test_description='git p4 fetching changes in multiple blocks'
7 test_expect_success 'start p4d' '
11 create_restricted_group() {
20 test_expect_success 'Create group with limited maxrows' '
21 create_restricted_group
24 test_expect_success 'Create a repo with many changes' '
26 client_view "//depot/included/... //client/included/..." \
27 "//depot/excluded/... //client/excluded/..." &&
28 mkdir -p "$cli/included" "$cli/excluded" &&
32 p4 submit -d "Add file.txt" &&
33 for i in $(test_seq 0 5)
37 p4 submit -d "Adding outer$i.txt" &&
38 for j in $(test_seq 0 5)
41 echo $i$j >file.txt &&
42 p4 submit -d "Commit $i$j" || exit
48 test_expect_success 'Default user cannot fetch changes' '
49 ! p4 changes -m 1 //depot/...
52 test_expect_success 'Clone the repo' '
53 git p4 clone --dest="$git" --changes-block-size=7 --verbose //depot/included@all
56 test_expect_success 'All files are present' '
57 echo file.txt >expected &&
58 test_write_lines outer0.txt outer1.txt outer2.txt outer3.txt outer4.txt >>expected &&
59 test_write_lines outer5.txt >>expected &&
61 test_cmp expected current
64 test_expect_success 'file.txt is correct' '
66 test_cmp expected "$git/file.txt"
69 test_expect_success 'Correct number of commits' '
70 (cd "$git" && git log --oneline) >log &&
72 test_line_count = 43 log
75 test_expect_success 'Previous version of file.txt is correct' '
76 (cd "$git" && git checkout HEAD^^) &&
78 test_cmp expected "$git/file.txt"
81 # Test git-p4 sync, with some files outside the client specification.
87 p4 submit -d "Added file $1" $1
91 test_expect_success 'Add some more files' '
92 for i in $(test_seq 0 10)
94 p4_add_file "included/x$i" &&
95 p4_add_file "excluded/x$i"
97 for i in $(test_seq 0 10)
99 p4_add_file "excluded/y$i"
103 # This should pick up the 10 new files in "included", but not be confused
104 # by the additional files in "excluded"
105 test_expect_success 'Syncing files' '
108 git p4 sync --changes-block-size=7 &&
109 git checkout p4/master &&
111 test_line_count = 11 log
115 # Handling of multiple depot paths:
116 # git p4 clone //depot/pathA //depot/pathB
118 test_expect_success 'Create a repo with multiple depot paths' '
119 client_view "//depot/pathA/... //client/pathA/..." \
120 "//depot/pathB/... //client/pathB/..." &&
121 mkdir -p "$cli/pathA" "$cli/pathB" &&
124 for i in $(test_seq 1 10)
126 p4_add_file "$p/file$p$i"
131 test_expect_success 'Clone repo with multiple depot paths' '
134 git p4 clone --changes-block-size=4 //depot/pathA@all //depot/pathB@all \
135 --destination=dest &&
137 test_line_count = 20 log
141 test_expect_success 'kill p4d' '