(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"Clone repositories and keep empty commits">)} spids: [4] ) ] spids: [4] ) (C {(.)} {(./lib-git-p4.sh)}) (C {(test_expect_success)} {(SQ <"start p4d">)} {(SQ <"\n"> <"\tstart_p4d\n">)}) (C {(test_expect_success)} {(SQ <"Create a repo">)} { (SQ <"\n"> <"\tclient_view \"//depot/... //client/...\" &&\n"> <"\t(\n"> <"\t\tcd \"$cli\" &&\n"> <"\n"> <"\t\tmkdir -p subdir &&\n"> <"\n"> <"\t\t>subdir/file1.txt &&\n"> <"\t\tp4 add subdir/file1.txt &&\n"> <"\t\tp4 submit -d \"Add file 1\" &&\n"> <"\n"> <"\t\t>file2.txt &&\n"> <"\t\tp4 add file2.txt &&\n"> <"\t\tp4 submit -d \"Add file 2\" &&\n"> <"\n"> <"\t\t>subdir/file3.txt &&\n"> <"\t\tp4 add subdir/file3.txt &&\n"> <"\t\tp4 submit -d \"Add file 3\" &&\n"> <"\n"> <"\t\t>file4.txt &&\n"> <"\t\tp4 add file4.txt &&\n"> <"\t\tp4 submit -d \"Add file 4\" &&\n"> <"\n"> <"\t\tp4 delete subdir/file3.txt &&\n"> <"\t\tp4 submit -d \"Remove file 3\" &&\n"> <"\n"> <"\t\tp4 delete file4.txt &&\n"> <"\t\tp4 submit -d \"Remove file 4\"\n"> <"\t)\n"> ) } ) (C {(test_expect_success)} {(SQ <"Clone repo root path with all history">)} { (SQ <"\n"> <"\tclient_view \"//depot/... //client/...\" &&\n"> <"\ttest_when_finished cleanup_git &&\n"> <"\t(\n"> <"\t\tcd \"$git\" &&\n"> <"\t\tgit init . &&\n"> <"\t\tgit p4 clone --use-client-spec --destination=\"$git\" //depot@all &&\n"> <"\t\tcat >expect <<-\\EOF &&\n"> <"\t\tRemove file 4\n"> <"\t\t[git-p4: depot-paths = \"//depot/\": change = 6]\n"> <"\n"> <"\t\tRemove file 3\n"> <"\t\t[git-p4: depot-paths = \"//depot/\": change = 5]\n"> <"\n"> <"\t\tAdd file 4\n"> <"\t\t[git-p4: depot-paths = \"//depot/\": change = 4]\n"> <"\n"> <"\t\tAdd file 3\n"> <"\t\t[git-p4: depot-paths = \"//depot/\": change = 3]\n"> <"\n"> <"\t\tAdd file 2\n"> <"\t\t[git-p4: depot-paths = \"//depot/\": change = 2]\n"> <"\n"> <"\t\tAdd file 1\n"> <"\t\t[git-p4: depot-paths = \"//depot/\": change = 1]\n"> <"\n"> <"\t\tEOF\n"> <"\t\tgit log --format=%B >actual &&\n"> <"\t\ttest_cmp expect actual\n"> <"\t)\n"> ) } ) (C {(test_expect_success)} {(SQ <"Clone repo subdir with all history but keep empty commits">)} { (SQ <"\n"> <"\tclient_view \"//depot/subdir/... //client/subdir/...\" &&\n"> <"\ttest_when_finished cleanup_git &&\n"> <"\t(\n"> <"\t\tcd \"$git\" &&\n"> <"\t\tgit init . &&\n"> <"\t\tgit config git-p4.keepEmptyCommits true &&\n"> <"\t\tgit p4 clone --use-client-spec --destination=\"$git\" //depot@all &&\n"> <"\t\tcat >expect <<-\\EOF &&\n"> <"\t\tRemove file 4\n"> <"\t\t[git-p4: depot-paths = \"//depot/\": change = 6]\n"> <"\n"> <"\t\tRemove file 3\n"> <"\t\t[git-p4: depot-paths = \"//depot/\": change = 5]\n"> <"\n"> <"\t\tAdd file 4\n"> <"\t\t[git-p4: depot-paths = \"//depot/\": change = 4]\n"> <"\n"> <"\t\tAdd file 3\n"> <"\t\t[git-p4: depot-paths = \"//depot/\": change = 3]\n"> <"\n"> <"\t\tAdd file 2\n"> <"\t\t[git-p4: depot-paths = \"//depot/\": change = 2]\n"> <"\n"> <"\t\tAdd file 1\n"> <"\t\t[git-p4: depot-paths = \"//depot/\": change = 1]\n"> <"\n"> <"\t\tEOF\n"> <"\t\tgit log --format=%B >actual &&\n"> <"\t\ttest_cmp expect actual\n"> <"\t)\n"> ) } ) (C {(test_expect_success)} {(SQ <"Clone repo subdir with all history">)} { (SQ <"\n"> <"\tclient_view \"//depot/subdir/... //client/subdir/...\" &&\n"> <"\ttest_when_finished cleanup_git &&\n"> <"\t(\n"> <"\t\tcd \"$git\" &&\n"> <"\t\tgit init . &&\n"> <"\t\tgit p4 clone --use-client-spec --destination=\"$git\" --verbose //depot@all &&\n"> <"\t\tcat >expect <<-\\EOF &&\n"> <"\t\tRemove file 3\n"> <"\t\t[git-p4: depot-paths = \"//depot/\": change = 5]\n"> <"\n"> <"\t\tAdd file 3\n"> <"\t\t[git-p4: depot-paths = \"//depot/\": change = 3]\n"> <"\n"> <"\t\tAdd file 1\n"> <"\t\t[git-p4: depot-paths = \"//depot/\": change = 1]\n"> <"\n"> <"\t\tEOF\n"> <"\t\tgit log --format=%B >actual &&\n"> <"\t\ttest_cmp expect actual\n"> <"\t)\n"> ) } ) (C {(test_expect_success)} {(SQ <"kill p4d">)} {(SQ <"\n"> <"\tkill_p4d\n">)}) (C {(test_done)}) ] )