{"thread":{"id":"29347","subject":"[PATCH 0/5] git-p4: view spec review fixes","startedAt":"2012-01-11T23:31:05Z","lastAt":"2012-01-11T23:31:10Z","messageCount":6,"participants":["Pete Wyckoff"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"182384","messageId":"1326324670-15967-1-git-send-email-pw@padd.com","threadId":"29347","inReplyTo":null,"subject":"[PATCH 0/5] git-p4: view spec review fixes","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2012-01-11T23:31:05Z","receivedAt":"2012-01-11T23:31:05Z","isPatch":true,"sender":{"key":"pw@padd.com","avatar":null},"body":"I received some helpful review comments offline regarding the\nseries recently merged into master (8cbfc11\n(Merge branch 'pw/p4-view-updates', 2012-01-06)).\n\nIt would be nice to see these go into 1.7.9 as well.\nEven though they belong there logically, they are\nminor fixes, and not critical.\n\nI added a bunch of new tests documenting further problems,\nbut will not fix those here as the changes will be more\ninvasive.\n\nThanks,\n\nPete Wyckoff (5):\n  git-p4: only a single ... wildcard is supported\n  git-p4: fix verbose comment typo\n  git-p4: clarify comment\n  git-p4: adjust test to adhere to stricter useClientSpec\n  git-p4: add tests demonstrating spec overlay ambiguities\n\n Documentation/git-p4.txt      |    5 +\n contrib/fast-import/git-p4    |    9 +-\n t/t9806-git-p4-options.sh     |    4 +-\n t/t9809-git-p4-client-view.sh |  395 ++++++++++++++++++++++++++++++++++++++++-\n 4 files changed, 406 insertions(+), 7 deletions(-)\n\n-- \n1.7.8.1.409.g3e338.dirty\n"},{"id":"182385","messageId":"1326324670-15967-2-git-send-email-pw@padd.com","threadId":"29347","inReplyTo":"1326324670-15967-1-git-send-email-pw@padd.com","subject":"[PATCH 1/5] git-p4: only a single ... wildcard is supported","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2012-01-11T23:31:06Z","receivedAt":"2012-01-11T23:31:06Z","isPatch":true,"sender":{"key":"pw@padd.com","avatar":null},"body":"Catch the case where a ... exists at the end, and also elsehwere.\n\nReported-by: Gary Gibbons <ggibbons@perforce.com>\nSigned-off-by: Pete Wyckoff <pw@padd.com>\n---\n contrib/fast-import/git-p4    |    4 ++--\n t/t9809-git-p4-client-view.sh |    8 +++++++-\n 2 files changed, 9 insertions(+), 3 deletions(-)\n\ndiff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\nindex 3e1aa27..20208bf 100755\n--- a/contrib/fast-import/git-p4\n+++ b/contrib/fast-import/git-p4\n@@ -1207,8 +1207,8 @@ class View(object):\n                 die(\"Can't handle * wildcards in view: %s\" % self.path)\n             triple_dot_index = self.path.find(\"...\")\n             if triple_dot_index >= 0:\n-                if not self.path.endswith(\"...\"):\n-                    die(\"Can handle ... wildcard only at end of path: %s\" %\n+                if triple_dot_index != len(self.path) - 3:\n+                    die(\"Can handle only single ... wildcard, at end: %s\" %\n                         self.path)\n                 self.ends_triple_dot = True\n \ndiff --git a/t/t9809-git-p4-client-view.sh b/t/t9809-git-p4-client-view.sh\nindex c9471d5..54204af 100755\n--- a/t/t9809-git-p4-client-view.sh\n+++ b/t/t9809-git-p4-client-view.sh\n@@ -101,12 +101,18 @@ test_expect_success 'unsupported view wildcard *' '\n \ttest_must_fail \"$GITP4\" clone --use-client-spec --dest=\"$git\" //depot\n '\n \n-test_expect_success 'wildcard ... only supported at end of spec' '\n+test_expect_success 'wildcard ... only supported at end of spec 1' '\n \tclient_view \"//depot/.../file11 //client/.../file11\" &&\n \ttest_when_finished cleanup_git &&\n \ttest_must_fail \"$GITP4\" clone --use-client-spec --dest=\"$git\" //depot\n '\n \n+test_expect_success 'wildcard ... only supported at end of spec 2' '\n+\tclient_view \"//depot/.../a/... //client/.../a/...\" &&\n+\ttest_when_finished cleanup_git &&\n+\ttest_must_fail \"$GITP4\" clone --use-client-spec --dest=\"$git\" //depot\n+'\n+\n test_expect_success 'basic map' '\n \tclient_view \"//depot/dir1/... //client/cli1/...\" &&\n \tfiles=\"cli1/file11 cli1/file12\" &&\n-- \n1.7.8.1.409.g3e338.dirty\n"},{"id":"182386","messageId":"1326324670-15967-3-git-send-email-pw@padd.com","threadId":"29347","inReplyTo":"1326324670-15967-1-git-send-email-pw@padd.com","subject":"[PATCH 2/5] git-p4: fix verbose comment typo","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2012-01-11T23:31:07Z","receivedAt":"2012-01-11T23:31:07Z","isPatch":true,"sender":{"key":"pw@padd.com","avatar":null},"body":"\nSigned-off-by: Pete Wyckoff <pw@padd.com>\n---\n contrib/fast-import/git-p4 |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\nindex 20208bf..e267f31 100755\n--- a/contrib/fast-import/git-p4\n+++ b/contrib/fast-import/git-p4\n@@ -1263,7 +1263,7 @@ class View(object):\n             if self.exclude:\n                 c = \"-\"\n             return \"View.Mapping: %s%s -> %s\" % \\\n-                   (c, self.depot_side, self.client_side)\n+                   (c, self.depot_side.path, self.client_side.path)\n \n         def map_depot_to_client(self, depot_path):\n             \"\"\"Calculate the client path if using this mapping on the\n-- \n1.7.8.1.409.g3e338.dirty\n"},{"id":"182387","messageId":"1326324670-15967-4-git-send-email-pw@padd.com","threadId":"29347","inReplyTo":"1326324670-15967-1-git-send-email-pw@padd.com","subject":"[PATCH 3/5] git-p4: clarify comment","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2012-01-11T23:31:08Z","receivedAt":"2012-01-11T23:31:08Z","isPatch":true,"sender":{"key":"pw@padd.com","avatar":null},"body":"\nSigned-off-by: Pete Wyckoff <pw@padd.com>\n---\n contrib/fast-import/git-p4 |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\nindex e267f31..e11e15b 100755\n--- a/contrib/fast-import/git-p4\n+++ b/contrib/fast-import/git-p4\n@@ -1363,7 +1363,8 @@ class View(object):\n             else:\n                 # This mapping matched; no need to search any further.\n                 # But, the mapping could be rejected if the client path\n-                # has already been claimed by an earlier mapping.\n+                # has already been claimed by an earlier mapping (i.e.\n+                # one later in the list, which we are walking backwards).\n                 already_mapped_in_client = False\n                 for f in paths_filled:\n                     # this is View.Path.match\n-- \n1.7.8.1.409.g3e338.dirty\n"},{"id":"182388","messageId":"1326324670-15967-5-git-send-email-pw@padd.com","threadId":"29347","inReplyTo":"1326324670-15967-1-git-send-email-pw@padd.com","subject":"[PATCH 4/5] git-p4: adjust test to adhere to stricter useClientSpec","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2012-01-11T23:31:09Z","receivedAt":"2012-01-11T23:31:09Z","isPatch":true,"sender":{"key":"pw@padd.com","avatar":null},"body":"This test relied on what now is seen as broken behavior\nin --use-client-spec.  Change it to make sure it works\naccording to the new behavior as described in\necb7cf9 (git-p4: rewrite view handling, 2012-01-02) and\nc700b68 (git-p4: test client view handling, 2012-01-02).\n\nSigned-off-by: Pete Wyckoff <pw@padd.com>\n---\n t/t9806-git-p4-options.sh |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t9806-git-p4-options.sh b/t/t9806-git-p4-options.sh\nindex 1f1952a..0571602 100755\n--- a/t/t9806-git-p4-options.sh\n+++ b/t/t9806-git-p4-options.sh\n@@ -146,7 +146,7 @@ test_expect_success 'clone --use-client-spec' '\n \t(\n \t\tcd \"$git\" &&\n \t\ttest_path_is_file bus/dir/f4 &&\n-\t\ttest_path_is_file file1\n+\t\ttest_path_is_missing file1\n \t) &&\n \tcleanup_git &&\n \n@@ -159,7 +159,7 @@ test_expect_success 'clone --use-client-spec' '\n \t\t\"$GITP4\" sync //depot/... &&\n \t\tgit checkout -b master p4/master &&\n \t\ttest_path_is_file bus/dir/f4 &&\n-\t\ttest_path_is_file file1\n+\t\ttest_path_is_missing file1\n \t)\n '\n \n-- \n1.7.8.1.409.g3e338.dirty\n"},{"id":"182389","messageId":"1326324670-15967-6-git-send-email-pw@padd.com","threadId":"29347","inReplyTo":"1326324670-15967-1-git-send-email-pw@padd.com","subject":"[PATCH 5/5] git-p4: add tests demonstrating spec overlay ambiguities","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2012-01-11T23:31:10Z","receivedAt":"2012-01-11T23:31:10Z","isPatch":true,"sender":{"key":"pw@padd.com","avatar":null},"body":"Introduce new tests that look more closely at overlay situations\nwhen there are conflicting files.  Five of these are broken.\nDocument the brokenness.\n\nThis is a fundamental problem with how git-p4 only \"borrows\" a\nclient spec.  At some sync operation, a new change can contain\na file which is already in the repo or explicitly deleted through\nanother mapping.  To sort this out would involve listing all the\nfiles in the client spec to find one with a higher priority.\nWhile this is not too hard for the initial import, subsequent\nsync operations would be very costly.\n\nSigned-off-by: Pete Wyckoff <pw@padd.com>\n---\n Documentation/git-p4.txt      |    5 +\n t/t9809-git-p4-client-view.sh |  387 +++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 392 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-p4.txt b/Documentation/git-p4.txt\nindex 78938b2..8b92cc0 100644\n--- a/Documentation/git-p4.txt\n+++ b/Documentation/git-p4.txt\n@@ -314,6 +314,11 @@ around whitespace.  Of the possible wildcards, git-p4 only handles\n '...', and only when it is at the end of the path.  Git-p4 will complain\n if it encounters an unhandled wildcard.\n \n+Bugs in the implementation of overlap mappings exist.  If multiple depot\n+paths map through overlays to the same location in the repository,\n+git-p4 can choose the wrong one.  This is hard to solve without\n+dedicating a client spec just for git-p4.\n+\n The name of the client can be given to git-p4 in multiple ways.  The\n variable 'git-p4.client' takes precedence if it exists.  Otherwise,\n normal p4 mechanisms of determining the client are used:  environment\ndiff --git a/t/t9809-git-p4-client-view.sh b/t/t9809-git-p4-client-view.sh\nindex 54204af..ae9145e 100755\n--- a/t/t9809-git-p4-client-view.sh\n+++ b/t/t9809-git-p4-client-view.sh\n@@ -247,6 +247,393 @@ test_expect_success 'quotes on rhs only' '\n '\n \n #\n+# What happens when two files of the same name are overlayed together?\n+# The last-listed file should take preference.\n+#\n+# //depot\n+#   - dir1\n+#     - file11\n+#     - file12\n+#     - filecollide\n+#   - dir2\n+#     - file21\n+#     - file22\n+#     - filecollide\n+#\n+test_expect_success 'overlay collision setup' '\n+\tclient_view \"//depot/... //client/...\" &&\n+\t(\n+\t\tcd \"$cli\" &&\n+\t\tp4 sync &&\n+\t\techo dir1/filecollide >dir1/filecollide &&\n+\t\tp4 add dir1/filecollide &&\n+\t\tp4 submit -d dir1/filecollide &&\n+\t\techo dir2/filecollide >dir2/filecollide &&\n+\t\tp4 add dir2/filecollide &&\n+\t\tp4 submit -d dir2/filecollide\n+\t)\n+'\n+\n+test_expect_success 'overlay collision 1 to 2' '\n+\tclient_view \"//depot/dir1/... //client/...\" \\\n+\t\t    \"+//depot/dir2/... //client/...\" &&\n+\tfiles=\"file11 file12 file21 file22 filecollide\" &&\n+\techo dir2/filecollide >actual &&\n+\tclient_verify $files &&\n+\ttest_cmp actual \"$cli\"/filecollide &&\n+\ttest_when_finished cleanup_git &&\n+\t\"$GITP4\" clone --use-client-spec --dest=\"$git\" //depot &&\n+\tgit_verify $files &&\n+\ttest_cmp actual \"$git\"/filecollide\n+'\n+\n+test_expect_failure 'overlay collision 2 to 1' '\n+\tclient_view \"//depot/dir2/... //client/...\" \\\n+\t\t    \"+//depot/dir1/... //client/...\" &&\n+\tfiles=\"file11 file12 file21 file22 filecollide\" &&\n+\techo dir1/filecollide >actual &&\n+\tclient_verify $files &&\n+\ttest_cmp actual \"$cli\"/filecollide &&\n+\ttest_when_finished cleanup_git &&\n+\t\"$GITP4\" clone --use-client-spec --dest=\"$git\" //depot &&\n+\tgit_verify $files &&\n+\ttest_cmp actual \"$git\"/filecollide\n+'\n+\n+test_expect_success 'overlay collision delete 2' '\n+\tclient_view \"//depot/... //client/...\" &&\n+\t(\n+\t\tcd \"$cli\" &&\n+\t\tp4 sync &&\n+\t\tp4 delete dir2/filecollide &&\n+\t\tp4 submit -d \"remove dir2/filecollide\"\n+\t)\n+'\n+\n+# no filecollide, got deleted with dir2\n+test_expect_failure 'overlay collision 1 to 2, but 2 deleted' '\n+\tclient_view \"//depot/dir1/... //client/...\" \\\n+\t\t    \"+//depot/dir2/... //client/...\" &&\n+\tfiles=\"file11 file12 file21 file22\" &&\n+\tclient_verify $files &&\n+\ttest_when_finished cleanup_git &&\n+\t\"$GITP4\" clone --use-client-spec --dest=\"$git\" //depot &&\n+\tgit_verify $files\n+'\n+\n+test_expect_success 'overlay collision update 1' '\n+\tclient_view \"//depot/dir1/... //client/dir1/...\" &&\n+\t(\n+\t\tcd \"$cli\" &&\n+\t\tp4 sync &&\n+\t\tp4 open dir1/filecollide &&\n+\t\techo dir1/filecollide update >dir1/filecollide &&\n+\t\tp4 submit -d \"update dir1/filecollide\"\n+\t)\n+'\n+\n+# still no filecollide, dir2 still wins with the deletion even though the\n+# change to dir1 is more recent\n+test_expect_failure 'overlay collision 1 to 2, but 2 deleted, then 1 updated' '\n+\tclient_view \"//depot/dir1/... //client/...\" \\\n+\t\t    \"+//depot/dir2/... //client/...\" &&\n+\tfiles=\"file11 file12 file21 file22\" &&\n+\tclient_verify $files &&\n+\ttest_when_finished cleanup_git &&\n+\t\"$GITP4\" clone --use-client-spec --dest=\"$git\" //depot &&\n+\tgit_verify $files\n+'\n+\n+test_expect_success 'overlay collision delete filecollides' '\n+\tclient_view \"//depot/... //client/...\" &&\n+\t(\n+\t\tcd \"$cli\" &&\n+\t\tp4 sync &&\n+\t\tp4 delete dir1/filecollide dir2/filecollide &&\n+\t\tp4 submit -d \"remove filecollides\"\n+\t)\n+'\n+\n+#\n+# Overlays as part of sync, rather than initial checkout:\n+#   1.  add a file in dir1\n+#   2.  sync to include it\n+#   3.  add same file in dir2\n+#   4.  sync, make sure content switches as dir2 has priority\n+#   5.  add another file in dir1\n+#   6.  sync\n+#   7.  add/delete same file in dir2\n+#   8.  sync, make sure it disappears, again dir2 wins\n+#   9.  cleanup\n+#\n+# //depot\n+#   - dir1\n+#     - file11\n+#     - file12\n+#     - colA\n+#     - colB\n+#   - dir2\n+#     - file21\n+#     - file22\n+#     - colA\n+#     - colB\n+#\n+test_expect_success 'overlay sync: add colA in dir1' '\n+\tclient_view \"//depot/dir1/... //client/dir1/...\" &&\n+\t(\n+\t\tcd \"$cli\" &&\n+\t\tp4 sync &&\n+\t\techo dir1/colA >dir1/colA &&\n+\t\tp4 add dir1/colA &&\n+\t\tp4 submit -d dir1/colA\n+\t)\n+'\n+\n+test_expect_success 'overlay sync: initial git checkout' '\n+\tclient_view \"//depot/dir1/... //client/...\" \\\n+\t\t    \"+//depot/dir2/... //client/...\" &&\n+\tfiles=\"file11 file12 file21 file22 colA\" &&\n+\techo dir1/colA >actual &&\n+\tclient_verify $files &&\n+\ttest_cmp actual \"$cli\"/colA &&\n+\t\"$GITP4\" clone --use-client-spec --dest=\"$git\" //depot &&\n+\tgit_verify $files &&\n+\ttest_cmp actual \"$git\"/colA\n+'\n+\n+test_expect_success 'overlay sync: add colA in dir2' '\n+\tclient_view \"//depot/dir2/... //client/dir2/...\" &&\n+\t(\n+\t\tcd \"$cli\" &&\n+\t\tp4 sync &&\n+\t\techo dir2/colA >dir2/colA &&\n+\t\tp4 add dir2/colA &&\n+\t\tp4 submit -d dir2/colA\n+\t)\n+'\n+\n+test_expect_success 'overlay sync: colA content switch' '\n+\tclient_view \"//depot/dir1/... //client/...\" \\\n+\t\t    \"+//depot/dir2/... //client/...\" &&\n+\tfiles=\"file11 file12 file21 file22 colA\" &&\n+\techo dir2/colA >actual &&\n+\tclient_verify $files &&\n+\ttest_cmp actual \"$cli\"/colA &&\n+\t(\n+\t\tcd \"$git\" &&\n+\t\t\"$GITP4\" sync --use-client-spec &&\n+\t\tgit merge --ff-only p4/master\n+\t) &&\n+\tgit_verify $files &&\n+\ttest_cmp actual \"$git\"/colA\n+'\n+\n+test_expect_success 'overlay sync: add colB in dir1' '\n+\tclient_view \"//depot/dir1/... //client/dir1/...\" &&\n+\t(\n+\t\tcd \"$cli\" &&\n+\t\tp4 sync &&\n+\t\techo dir1/colB >dir1/colB &&\n+\t\tp4 add dir1/colB &&\n+\t\tp4 submit -d dir1/colB\n+\t)\n+'\n+\n+test_expect_success 'overlay sync: colB appears' '\n+\tclient_view \"//depot/dir1/... //client/...\" \\\n+\t\t    \"+//depot/dir2/... //client/...\" &&\n+\tfiles=\"file11 file12 file21 file22 colA colB\" &&\n+\techo dir1/colB >actual &&\n+\tclient_verify $files &&\n+\ttest_cmp actual \"$cli\"/colB &&\n+\t(\n+\t\tcd \"$git\" &&\n+\t\t\"$GITP4\" sync --use-client-spec &&\n+\t\tgit merge --ff-only p4/master\n+\t) &&\n+\tgit_verify $files &&\n+\ttest_cmp actual \"$git\"/colB\n+'\n+\n+test_expect_success 'overlay sync: add/delete colB in dir2' '\n+\tclient_view \"//depot/dir2/... //client/dir2/...\" &&\n+\t(\n+\t\tcd \"$cli\" &&\n+\t\tp4 sync &&\n+\t\techo dir2/colB >dir2/colB &&\n+\t\tp4 add dir2/colB &&\n+\t\tp4 submit -d dir2/colB &&\n+\t\tp4 delete dir2/colB &&\n+\t\tp4 submit -d \"delete dir2/colB\"\n+\t)\n+'\n+\n+test_expect_success 'overlay sync: colB disappears' '\n+\tclient_view \"//depot/dir1/... //client/...\" \\\n+\t\t    \"+//depot/dir2/... //client/...\" &&\n+\tfiles=\"file11 file12 file21 file22 colA\" &&\n+\tclient_verify $files &&\n+\ttest_when_finished cleanup_git &&\n+\t(\n+\t\tcd \"$git\" &&\n+\t\t\"$GITP4\" sync --use-client-spec &&\n+\t\tgit merge --ff-only p4/master\n+\t) &&\n+\tgit_verify $files\n+'\n+\n+test_expect_success 'overlay sync: cleanup' '\n+\tclient_view \"//depot/... //client/...\" &&\n+\t(\n+\t\tcd \"$cli\" &&\n+\t\tp4 sync &&\n+\t\tp4 delete dir1/colA dir2/colA dir1/colB &&\n+\t\tp4 submit -d \"remove overlay sync files\"\n+\t)\n+'\n+\n+#\n+# Overlay tests again, but swapped so dir1 has priority.\n+#   1.  add a file in dir1\n+#   2.  sync to include it\n+#   3.  add same file in dir2\n+#   4.  sync, make sure content does not switch\n+#   5.  add another file in dir1\n+#   6.  sync\n+#   7.  add/delete same file in dir2\n+#   8.  sync, make sure it is still there\n+#   9.  cleanup\n+#\n+# //depot\n+#   - dir1\n+#     - file11\n+#     - file12\n+#     - colA\n+#     - colB\n+#   - dir2\n+#     - file21\n+#     - file22\n+#     - colA\n+#     - colB\n+#\n+test_expect_success 'overlay sync swap: add colA in dir1' '\n+\tclient_view \"//depot/dir1/... //client/dir1/...\" &&\n+\t(\n+\t\tcd \"$cli\" &&\n+\t\tp4 sync &&\n+\t\techo dir1/colA >dir1/colA &&\n+\t\tp4 add dir1/colA &&\n+\t\tp4 submit -d dir1/colA\n+\t)\n+'\n+\n+test_expect_success 'overlay sync swap: initial git checkout' '\n+\tclient_view \"//depot/dir2/... //client/...\" \\\n+\t\t    \"+//depot/dir1/... //client/...\" &&\n+\tfiles=\"file11 file12 file21 file22 colA\" &&\n+\techo dir1/colA >actual &&\n+\tclient_verify $files &&\n+\ttest_cmp actual \"$cli\"/colA &&\n+\t\"$GITP4\" clone --use-client-spec --dest=\"$git\" //depot &&\n+\tgit_verify $files &&\n+\ttest_cmp actual \"$git\"/colA\n+'\n+\n+test_expect_success 'overlay sync swap: add colA in dir2' '\n+\tclient_view \"//depot/dir2/... //client/dir2/...\" &&\n+\t(\n+\t\tcd \"$cli\" &&\n+\t\tp4 sync &&\n+\t\techo dir2/colA >dir2/colA &&\n+\t\tp4 add dir2/colA &&\n+\t\tp4 submit -d dir2/colA\n+\t)\n+'\n+\n+test_expect_failure 'overlay sync swap: colA no content switch' '\n+\tclient_view \"//depot/dir2/... //client/...\" \\\n+\t\t    \"+//depot/dir1/... //client/...\" &&\n+\tfiles=\"file11 file12 file21 file22 colA\" &&\n+\techo dir1/colA >actual &&\n+\tclient_verify $files &&\n+\ttest_cmp actual \"$cli\"/colA &&\n+\t(\n+\t\tcd \"$git\" &&\n+\t\t\"$GITP4\" sync --use-client-spec &&\n+\t\tgit merge --ff-only p4/master\n+\t) &&\n+\tgit_verify $files &&\n+\ttest_cmp actual \"$git\"/colA\n+'\n+\n+test_expect_success 'overlay sync swap: add colB in dir1' '\n+\tclient_view \"//depot/dir1/... //client/dir1/...\" &&\n+\t(\n+\t\tcd \"$cli\" &&\n+\t\tp4 sync &&\n+\t\techo dir1/colB >dir1/colB &&\n+\t\tp4 add dir1/colB &&\n+\t\tp4 submit -d dir1/colB\n+\t)\n+'\n+\n+test_expect_success 'overlay sync swap: colB appears' '\n+\tclient_view \"//depot/dir2/... //client/...\" \\\n+\t\t    \"+//depot/dir1/... //client/...\" &&\n+\tfiles=\"file11 file12 file21 file22 colA colB\" &&\n+\techo dir1/colB >actual &&\n+\tclient_verify $files &&\n+\ttest_cmp actual \"$cli\"/colB &&\n+\t(\n+\t\tcd \"$git\" &&\n+\t\t\"$GITP4\" sync --use-client-spec &&\n+\t\tgit merge --ff-only p4/master\n+\t) &&\n+\tgit_verify $files &&\n+\ttest_cmp actual \"$git\"/colB\n+'\n+\n+test_expect_success 'overlay sync swap: add/delete colB in dir2' '\n+\tclient_view \"//depot/dir2/... //client/dir2/...\" &&\n+\t(\n+\t\tcd \"$cli\" &&\n+\t\tp4 sync &&\n+\t\techo dir2/colB >dir2/colB &&\n+\t\tp4 add dir2/colB &&\n+\t\tp4 submit -d dir2/colB &&\n+\t\tp4 delete dir2/colB &&\n+\t\tp4 submit -d \"delete dir2/colB\"\n+\t)\n+'\n+\n+test_expect_failure 'overlay sync swap: colB no change' '\n+\tclient_view \"//depot/dir2/... //client/...\" \\\n+\t\t    \"+//depot/dir1/... //client/...\" &&\n+\tfiles=\"file11 file12 file21 file22 colA colB\" &&\n+\techo dir1/colB >actual &&\n+\tclient_verify $files &&\n+\ttest_cmp actual \"$cli\"/colB &&\n+\ttest_when_finished cleanup_git &&\n+\t(\n+\t\tcd \"$git\" &&\n+\t\t\"$GITP4\" sync --use-client-spec &&\n+\t\tgit merge --ff-only p4/master\n+\t) &&\n+\tgit_verify $files &&\n+\ttest_cmp actual \"$cli\"/colB\n+'\n+\n+test_expect_success 'overlay sync swap: cleanup' '\n+\tclient_view \"//depot/... //client/...\" &&\n+\t(\n+\t\tcd \"$cli\" &&\n+\t\tp4 sync &&\n+\t\tp4 delete dir1/colA dir2/colA dir1/colB &&\n+\t\tp4 submit -d \"remove overlay sync files\"\n+\t)\n+'\n+\n+#\n # Rename directories to test quoting in depot-side mappings\n # //depot\n #    - \"dir 1\"\n-- \n1.7.8.1.409.g3e338.dirty\n"}]}