{"thread":{"id":"31013","subject":"[PATCHv2 0/2] git p4: use \"move\" command for renames","startedAt":"2012-07-12T23:28:58Z","lastAt":"2012-11-11T22:52:13Z","messageCount":7,"participants":["Pete Wyckoff","Vitor Antunes"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"194993","messageId":"1342135740-30290-1-git-send-email-pw@padd.com","threadId":"31013","inReplyTo":null,"subject":"[PATCHv2 0/2] git p4: use \"move\" command for renames","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2012-07-12T23:28:58Z","receivedAt":"2012-07-12T23:28:58Z","isPatch":false,"sender":{"key":"pw@padd.com","avatar":null},"body":"Difference from v1:\n    * Remove \"tee\" usage in t9814, just send output to a file\n      and grep it directly.\n\nRecent p4 supports a \"move\" command that records explicitly that\na file was moved from one place to another.  It can be changed a bit\nduring the move, too.  Use this feature, if it exists, when renames\nare detected.\n\nGary sent these patches months ago, and I've been sitting on them\nfar too long.  Was hoping to move some other work out first, but it\nwas not ready.\n\nThese commits are on origin/next, as they depend on changes\nin pw/git-p4-tests that was merged into next on Jul 3.  They\ndo not conflict with the other series in flight, \"notice Jobs: ...\".\n\n\nGary Gibbons (2):\n  git p4: refactor diffOpts calculation\n  git p4: add support for 'p4 move' in P4Submit\n\n Documentation/git-p4.txt | 10 +++---\n git-p4.py                | 86 ++++++++++++++++++++++++++++++++----------------\n t/t9814-git-p4-rename.sh | 16 ++++-----\n 3 files changed, 72 insertions(+), 40 deletions(-)\n\n-- \n1.7.11.1.72.g3344471\n"},{"id":"194994","messageId":"1342135740-30290-2-git-send-email-pw@padd.com","threadId":"31013","inReplyTo":"1342135740-30290-1-git-send-email-pw@padd.com","subject":"[PATCHv2 1/2] git p4: refactor diffOpts calculation","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2012-07-12T23:28:59Z","receivedAt":"2012-07-12T23:28:59Z","isPatch":false,"sender":{"key":"pw@padd.com","avatar":null},"body":"From: Gary Gibbons <ggibbons@perforce.com>\n\nP4Submit.applyCommit()\n\nTo avoid recalculating the same diffOpts for each commit, move it\nout of applyCommit() and into the top-level run().  Also fix a bug\nin that code which interpreted the value of detectRenames as a\nstring rather than as a boolean.\n\n[pw: fix documentation, rearrange code a bit]\n\nSigned-off-by: Gary Gibbons <ggibbons@perforce.com>\nSigned-off-by: Pete Wyckoff <pw@padd.com>\n---\n Documentation/git-p4.txt | 10 ++++++----\n git-p4.py                | 52 +++++++++++++++++++++++++++++-------------------\n 2 files changed, 38 insertions(+), 24 deletions(-)\n\ndiff --git a/Documentation/git-p4.txt b/Documentation/git-p4.txt\nindex fe1f49b..8228f33 100644\n--- a/Documentation/git-p4.txt\n+++ b/Documentation/git-p4.txt\n@@ -255,7 +255,7 @@ These options can be used to modify 'git p4 submit' behavior.\n \tp4.  By default, this is the most recent p4 commit reachable\n \tfrom 'HEAD'.\n \n--M[<n>]::\n+-M::\n \tDetect renames.  See linkgit:git-diff[1].  Renames will be\n \trepresented in p4 using explicit 'move' operations.  There\n \tis no corresponding option to detect copies, but there are\n@@ -465,13 +465,15 @@ git-p4.useClientSpec::\n Submit variables\n ~~~~~~~~~~~~~~~~\n git-p4.detectRenames::\n-\tDetect renames.  See linkgit:git-diff[1].\n+\tDetect renames.  See linkgit:git-diff[1].  This can be true,\n+\tfalse, or a score as expected by 'git diff -M'.\n \n git-p4.detectCopies::\n-\tDetect copies.  See linkgit:git-diff[1].\n+\tDetect copies.  See linkgit:git-diff[1].  This can be true,\n+\tfalse, or a score as expected by 'git diff -C'.\n \n git-p4.detectCopiesHarder::\n-\tDetect copies harder.  See linkgit:git-diff[1].\n+\tDetect copies harder.  See linkgit:git-diff[1].  A boolean.\n \n git-p4.preserveUser::\n \tOn submit, re-author changes to reflect the git author,\ndiff --git a/git-p4.py b/git-p4.py\nindex f895a24..5fe509f 100755\n--- a/git-p4.py\n+++ b/git-p4.py\n@@ -1046,27 +1046,8 @@ class P4Submit(Command, P4UserMap):\n \n         (p4User, gitEmail) = self.p4UserForCommit(id)\n \n-        if not self.detectRenames:\n-            # If not explicitly set check the config variable\n-            self.detectRenames = gitConfig(\"git-p4.detectRenames\")\n-\n-        if self.detectRenames.lower() == \"false\" or self.detectRenames == \"\":\n-            diffOpts = \"\"\n-        elif self.detectRenames.lower() == \"true\":\n-            diffOpts = \"-M\"\n-        else:\n-            diffOpts = \"-M%s\" % self.detectRenames\n-\n-        detectCopies = gitConfig(\"git-p4.detectCopies\")\n-        if detectCopies.lower() == \"true\":\n-            diffOpts += \" -C\"\n-        elif detectCopies != \"\" and detectCopies.lower() != \"false\":\n-            diffOpts += \" -C%s\" % detectCopies\n \n-        if gitConfig(\"git-p4.detectCopiesHarder\", \"--bool\") == \"true\":\n-            diffOpts += \" --find-copies-harder\"\n-\n-        diff = read_pipe_lines(\"git diff-tree -r %s \\\"%s^\\\" \\\"%s\\\"\" % (diffOpts, id, id))\n+        diff = read_pipe_lines(\"git diff-tree -r %s \\\"%s^\\\" \\\"%s\\\"\" % (self.diffOpts, id, id))\n         filesToAdd = set()\n         filesToDelete = set()\n         editedFiles = set()\n@@ -1433,6 +1414,37 @@ class P4Submit(Command, P4UserMap):\n         if self.preserveUser:\n             self.checkValidP4Users(commits)\n \n+        #\n+        # Build up a set of options to be passed to diff when\n+        # submitting each commit to p4.\n+        #\n+        if self.detectRenames:\n+            # command-line -M arg\n+            self.diffOpts = \"-M\"\n+        else:\n+            # If not explicitly set check the config variable\n+            detectRenames = gitConfig(\"git-p4.detectRenames\")\n+\n+            if detectRenames.lower() == \"false\" or detectRenames == \"\":\n+                self.diffOpts = \"\"\n+            elif detectRenames.lower() == \"true\":\n+                self.diffOpts = \"-M\"\n+            else:\n+                self.diffOpts = \"-M%s\" % detectRenames\n+\n+        # no command-line arg for -C or --find-copies-harder, just\n+        # config variables\n+        detectCopies = gitConfig(\"git-p4.detectCopies\")\n+        if detectCopies.lower() == \"false\" or detectCopies == \"\":\n+            pass\n+        elif detectCopies.lower() == \"true\":\n+            self.diffOpts += \" -C\"\n+        else:\n+            self.diffOpts += \" -C%s\" % detectCopies\n+\n+        if gitConfig(\"git-p4.detectCopiesHarder\", \"--bool\") == \"true\":\n+            self.diffOpts += \" --find-copies-harder\"\n+\n         while len(commits) > 0:\n             commit = commits[0]\n             commits = commits[1:]\n-- \n1.7.11.1.72.g3344471\n"},{"id":"194995","messageId":"1342135740-30290-3-git-send-email-pw@padd.com","threadId":"31013","inReplyTo":"1342135740-30290-1-git-send-email-pw@padd.com","subject":"[PATCHv2 2/2] git p4: add support for 'p4 move' in P4Submit","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2012-07-12T23:29:00Z","receivedAt":"2012-07-12T23:29:00Z","isPatch":false,"sender":{"key":"pw@padd.com","avatar":null},"body":"From: Gary Gibbons <ggibbons@perforce.com>\n\nFor -M option (detectRenames) in P4Submit, use 'p4 move' rather\nthan 'p4 integrate'.  Check Perforce server for exisitence of\n'p4 move' and use it if present, otherwise revert to 'p4 integrate'.\n\n[pw: wildcard-encode src/dest, add/update tests, tweak code]\n\nSigned-off-by: Gary Gibbons <ggibbons@perforce.com>\nSigned-off-by: Pete Wyckoff <pw@padd.com>\n---\n git-p4.py                | 34 ++++++++++++++++++++++++++--------\n t/t9814-git-p4-rename.sh | 16 ++++++++--------\n 2 files changed, 34 insertions(+), 16 deletions(-)\n\ndiff --git a/git-p4.py b/git-p4.py\nindex 5fe509f..b79e6f0 100755\n--- a/git-p4.py\n+++ b/git-p4.py\n@@ -120,6 +120,15 @@ def p4_read_pipe_lines(c):\n     real_cmd = p4_build_cmd(c)\n     return read_pipe_lines(real_cmd)\n \n+def p4_has_command(cmd):\n+    \"\"\"Ask p4 for help on this command.  If it returns an error, the\n+       command does not exist in this version of p4.\"\"\"\n+    real_cmd = p4_build_cmd([\"help\", cmd])\n+    p = subprocess.Popen(real_cmd, stdout=subprocess.PIPE,\n+                                   stderr=subprocess.PIPE)\n+    p.communicate()\n+    return p.returncode == 0\n+\n def system(cmd):\n     expand = isinstance(cmd,basestring)\n     if verbose:\n@@ -157,6 +166,9 @@ def p4_revert(f):\n def p4_reopen(type, f):\n     p4_system([\"reopen\", \"-t\", type, wildcard_encode(f)])\n \n+def p4_move(src, dest):\n+    p4_system([\"move\", \"-k\", wildcard_encode(src), wildcard_encode(dest)])\n+\n #\n # Canonicalize the p4 type and return a tuple of the\n # base type, plus any modifiers.  See \"p4 help filetypes\"\n@@ -850,6 +862,7 @@ class P4Submit(Command, P4UserMap):\n         self.preserveUser = gitConfig(\"git-p4.preserveUser\").lower() == \"true\"\n         self.isWindows = (platform.system() == \"Windows\")\n         self.exportLabels = False\n+        self.p4HasMoveCommand = p4_has_command(\"move\") \n \n     def check(self):\n         if len(p4CmdList(\"opened ...\")) > 0:\n@@ -1046,7 +1059,6 @@ class P4Submit(Command, P4UserMap):\n \n         (p4User, gitEmail) = self.p4UserForCommit(id)\n \n-\n         diff = read_pipe_lines(\"git diff-tree -r %s \\\"%s^\\\" \\\"%s\\\"\" % (self.diffOpts, id, id))\n         filesToAdd = set()\n         filesToDelete = set()\n@@ -1087,17 +1099,23 @@ class P4Submit(Command, P4UserMap):\n                 editedFiles.add(dest)\n             elif modifier == \"R\":\n                 src, dest = diff['src'], diff['dst']\n-                p4_integrate(src, dest)\n-                if diff['src_sha1'] != diff['dst_sha1']:\n-                    p4_edit(dest)\n+                if self.p4HasMoveCommand:\n+                    p4_edit(src)        # src must be open before move\n+                    p4_move(src, dest)  # opens for (move/delete, move/add)\n                 else:\n-                    pureRenameCopy.add(dest)\n+                    p4_integrate(src, dest)\n+                    if diff['src_sha1'] != diff['dst_sha1']:\n+                        p4_edit(dest)\n+                    else:\n+                        pureRenameCopy.add(dest)\n                 if isModeExecChanged(diff['src_mode'], diff['dst_mode']):\n-                    p4_edit(dest)\n+                    if not self.p4HasMoveCommand:\n+                        p4_edit(dest)   # with move: already open, writable\n                     filesToChangeExecBit[dest] = diff['dst_mode']\n-                os.unlink(dest)\n+                if not self.p4HasMoveCommand:\n+                    os.unlink(dest)\n+                    filesToDelete.add(src)\n                 editedFiles.add(dest)\n-                filesToDelete.add(src)\n             else:\n                 die(\"unknown modifier %s for %s\" % (modifier, path))\n \ndiff --git a/t/t9814-git-p4-rename.sh b/t/t9814-git-p4-rename.sh\nindex 84fffb3..3bf1224 100755\n--- a/t/t9814-git-p4-rename.sh\n+++ b/t/t9814-git-p4-rename.sh\n@@ -77,16 +77,16 @@ test_expect_success 'detect renames' '\n \t\tgit commit -a -m \"Rename file1 to file4\" &&\n \t\tgit diff-tree -r -M HEAD &&\n \t\tgit p4 submit &&\n-\t\tp4 filelog //depot/file4 &&\n-\t\tp4 filelog //depot/file4 | test_must_fail grep -q \"branch from\" &&\n+\t\tp4 filelog //depot/file4 >filelog &&\n+\t\t! grep \" from //depot\" filelog &&\n \n \t\tgit mv file4 file5 &&\n \t\tgit commit -a -m \"Rename file4 to file5\" &&\n \t\tgit diff-tree -r -M HEAD &&\n \t\tgit config git-p4.detectRenames true &&\n \t\tgit p4 submit &&\n-\t\tp4 filelog //depot/file5 &&\n-\t\tp4 filelog //depot/file5 | grep -q \"branch from //depot/file4\" &&\n+\t\tp4 filelog //depot/file5 >filelog &&\n+\t\tgrep \" from //depot/file4\" filelog &&\n \n \t\tgit mv file5 file6 &&\n \t\techo update >>file6 &&\n@@ -97,8 +97,8 @@ test_expect_success 'detect renames' '\n \t\ttest -n \"$level\" && test \"$level\" -gt 0 && test \"$level\" -lt 98 &&\n \t\tgit config git-p4.detectRenames $(($level + 2)) &&\n \t\tgit p4 submit &&\n-\t\tp4 filelog //depot/file6 &&\n-\t\tp4 filelog //depot/file6 | test_must_fail grep -q \"branch from\" &&\n+\t\tp4 filelog //depot/file6 >filelog &&\n+\t\t! grep \" from //depot\" filelog &&\n \n \t\tgit mv file6 file7 &&\n \t\techo update >>file7 &&\n@@ -109,8 +109,8 @@ test_expect_success 'detect renames' '\n \t\ttest -n \"$level\" && test \"$level\" -gt 2 && test \"$level\" -lt 100 &&\n \t\tgit config git-p4.detectRenames $(($level - 2)) &&\n \t\tgit p4 submit &&\n-\t\tp4 filelog //depot/file7 &&\n-\t\tp4 filelog //depot/file7 | grep -q \"branch from //depot/file6\"\n+\t\tp4 filelog //depot/file7 >filelog &&\n+\t\tgrep \" from //depot/file6\" filelog\n \t)\n '\n \n-- \n1.7.11.1.72.g3344471\n"},{"id":"202559","messageId":"loom.20121105T183530-627@post.gmane.org","threadId":"31013","inReplyTo":"1342135740-30290-3-git-send-email-pw@padd.com","subject":"Re: [PATCHv2 2/2] git p4: add support for 'p4 move' in P4Submit","fromName":"Vitor Antunes","fromEmail":"vitor.hda@gmail.com","sentAt":"2012-11-05T17:37:15Z","receivedAt":"2012-11-05T17:37:15Z","isPatch":false,"sender":{"key":"vitor.hda@gmail.com","avatar":"https://avatars.githubusercontent.com/u/606876?v=4"},"body":"Pete Wyckoff <pw <at> padd.com> writes:\n\n> \n> From: Gary Gibbons <ggibbons <at> perforce.com>\n> \n> For -M option (detectRenames) in P4Submit, use 'p4 move' rather\n> than 'p4 integrate'.  Check Perforce server for exisitence of\n> 'p4 move' and use it if present, otherwise revert to 'p4 integrate'.\n> \n\nHi Pete,\n\nI've just been hit by a situation where this command is available but is\ndisabled in the server. I don't know what is the best approach to avoid\nthis issue.\n\nThanks,\nVitor\n"},{"id":"202561","messageId":"20121105175724.GB889@padd.com","threadId":"31013","inReplyTo":"loom.20121105T183530-627@post.gmane.org","subject":"Re: [PATCHv2 2/2] git p4: add support for 'p4 move' in P4Submit","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2012-11-05T17:57:24Z","receivedAt":"2012-11-05T17:57:24Z","isPatch":false,"sender":{"key":"pw@padd.com","avatar":null},"body":"vitor.hda@gmail.com wrote on Mon, 05 Nov 2012 17:37 +0000:\n> Pete Wyckoff <pw <at> padd.com> writes:\n> \n> > \n> > From: Gary Gibbons <ggibbons <at> perforce.com>\n> > \n> > For -M option (detectRenames) in P4Submit, use 'p4 move' rather\n> > than 'p4 integrate'.  Check Perforce server for exisitence of\n> > 'p4 move' and use it if present, otherwise revert to 'p4 integrate'.\n> > \n> \n> Hi Pete,\n> \n> I've just been hit by a situation where this command is available but is\n> disabled in the server. I don't know what is the best approach to avoid\n> this issue.\n\nReally?  The command exists in the server because it returns the\ntext output for \"p4 help move\".  But \"p4 move\" itself fails\nbecause it is somehow disabled in the server?\n\nI didn't even know it was possible to administratively disable\ncommands.\n\nWhat's the actual error message?  And versions of your client and\nserver (p4 -V, p4d -V, p4 info).\n\nAny ideas Gary?\n\n\t\t-- Pete\n"},{"id":"202620","messageId":"CAOpHH-VRhOHqeROfjeLBQxqft23VemJZntGNJ-y7CX0A8N3q1A@mail.gmail.com","threadId":"31013","inReplyTo":"20121105175724.GB889@padd.com","subject":"Re: [PATCHv2 2/2] git p4: add support for 'p4 move' in P4Submit","fromName":"Vitor Antunes","fromEmail":"vitor.hda@gmail.com","sentAt":"2012-11-07T21:06:58Z","receivedAt":"2012-11-07T21:06:58Z","isPatch":false,"sender":{"key":"vitor.hda@gmail.com","avatar":"https://avatars.githubusercontent.com/u/606876?v=4"},"body":"On Mon, Nov 5, 2012 at 5:57 PM, Pete Wyckoff <pw@padd.com> wrote:\n> vitor.hda@gmail.com wrote on Mon, 05 Nov 2012 17:37 +0000:\n>> Hi Pete,\n>>\n>> I've just been hit by a situation where this command is available but is\n>> disabled in the server. I don't know what is the best approach to avoid\n>> this issue.\n>\n> Really?  The command exists in the server because it returns the\n> text output for \"p4 help move\".  But \"p4 move\" itself fails\n> because it is somehow disabled in the server?\n>\n> I didn't even know it was possible to administratively disable\n> commands.\n>\n> What's the actual error message?  And versions of your client and\n> server (p4 -V, p4d -V, p4 info).\n>\n> Any ideas Gary?\n\nI don't feel comfortable in testing this again because I'm working in a\nproduction server. Can Gary provide any details on this type of\nconfiguration on the server side?\n\nVitor\n"},{"id":"202927","messageId":"20121111225213.GA15548@padd.com","threadId":"31013","inReplyTo":"CAOpHH-VRhOHqeROfjeLBQxqft23VemJZntGNJ-y7CX0A8N3q1A@mail.gmail.com","subject":"[PATCH] git p4: handle servers without move support","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2012-11-11T22:52:13Z","receivedAt":"2012-11-11T22:52:13Z","isPatch":true,"sender":{"key":"pw@padd.com","avatar":null},"body":"Support for the \"p4 move\" command was added in 8e9497c (git p4:\nadd support for 'p4 move' in P4Submit, 2012-07-12), which checks\nto make sure the client and server support the command.\n\nBut older versions of p4d may not handle the \"-k\" argument, and\nnewer p4d allow disabling \"p4 move\" with a configurable.  Check\nfor both these cases by testing a p4 move command on bogus\nfilenames and looking for strings in the error messages.\n\nSigned-off-by: Pete Wyckoff <pw@padd.com>\n---\nvitor.hda@gmail.com wrote on Wed, 07 Nov 2012 21:06 +0000:\n> On Mon, Nov 5, 2012 at 5:57 PM, Pete Wyckoff <pw@padd.com> wrote:\n> > vitor.hda@gmail.com wrote on Mon, 05 Nov 2012 17:37 +0000:\n> >> Hi Pete,\n> >>\n> >> I've just been hit by a situation where this command is available but is\n> >> disabled in the server. I don't know what is the best approach to avoid\n> >> this issue.\n> >\n> > Really?  The command exists in the server because it returns the\n> > text output for \"p4 help move\".  But \"p4 move\" itself fails\n> > because it is somehow disabled in the server?\n> >\n> > I didn't even know it was possible to administratively disable\n> > commands.\n> >\n> > What's the actual error message?  And versions of your client and\n> > server (p4 -V, p4d -V, p4 info).\n> >\n> > Any ideas Gary?\n> \n> I don't feel comfortable in testing this again because I'm working in a\n> production server. Can Gary provide any details on this type of\n> configuration on the server side?\n\nGary explained how to administratively disable \"p4 move\".  This\npatch checks for that condition, and \"p4 move -k\", which is\nmissing in p4d 2009.1.\n\nI'm not super happy with it, due to the string-searching in the\nerror messages.  But I can't think of a better way:  if \"p4 move\n-k src dest\" returns 1, is it because the server doesn't support\nit?  arguments were wrong?  printer on fire?\n\nVitor, can you test that it works for you?  It's probably worth\nputting in the code just so no one else finds the same mysterious\nfailure.\n\n\t\t-- Pete\n\n git-p4.py                | 21 ++++++++++++++++++++-\n t/t9814-git-p4-rename.sh | 35 +++++++++++++++++++++++++++++++++++\n 2 files changed, 55 insertions(+), 1 deletion(-)\n\ndiff --git a/git-p4.py b/git-p4.py\nindex 882b1bb..417a66a 100755\n--- a/git-p4.py\n+++ b/git-p4.py\n@@ -129,6 +129,25 @@ def p4_has_command(cmd):\n     p.communicate()\n     return p.returncode == 0\n \n+def p4_has_move_command():\n+    \"\"\"See if the move command exists, that it supports -k, and that\n+       it has not been administratively disabled.  The arguments\n+       must be correct, but the filenames do not have to exist.  Use\n+       ones with wildcards so even if they exist, it will fail.\"\"\"\n+\n+    if not p4_has_command(\"move\"):\n+        return False\n+    cmd = p4_build_cmd([\"move\", \"-k\", \"@from\", \"@to\"])\n+    p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)\n+    (out, err) = p.communicate()\n+    # return code will be 1 in either case\n+    if err.find(\"Invalid option\") >= 0:\n+        return False\n+    if err.find(\"disabled\") >= 0:\n+        return False\n+    # assume it failed because @... was invalid changelist\n+    return True\n+\n def system(cmd):\n     expand = isinstance(cmd,basestring)\n     if verbose:\n@@ -871,7 +890,7 @@ class P4Submit(Command, P4UserMap):\n         self.conflict_behavior = None\n         self.isWindows = (platform.system() == \"Windows\")\n         self.exportLabels = False\n-        self.p4HasMoveCommand = p4_has_command(\"move\")\n+        self.p4HasMoveCommand = p4_has_move_command()\n \n     def check(self):\n         if len(p4CmdList(\"opened ...\")) > 0:\ndiff --git a/t/t9814-git-p4-rename.sh b/t/t9814-git-p4-rename.sh\nindex 3bf1224..be802e0 100755\n--- a/t/t9814-git-p4-rename.sh\n+++ b/t/t9814-git-p4-rename.sh\n@@ -199,6 +199,41 @@ test_expect_success 'detect copies' '\n \t)\n '\n \n+# See if configurables can be set, and in particular if the run.move.allow\n+# variable exists, which allows admins to disable the \"p4 move\" command.\n+test_expect_success 'p4 configure command and run.move.allow are available' '\n+\tp4 configure show run.move.allow >out ; retval=$? &&\n+\ttest $retval = 0 &&\n+\t{\n+\t\tegrep ^run.move.allow: out &&\n+\t\ttest_set_prereq P4D_HAVE_CONFIGURABLE_RUN_MOVE_ALLOW ||\n+\t\ttrue\n+\t} || true\n+'\n+\n+# If move can be disabled, turn it off and test p4 move handling\n+test_expect_success P4D_HAVE_CONFIGURABLE_RUN_MOVE_ALLOW \\\n+\t\t    'do not use p4 move when administratively disabled' '\n+\ttest_when_finished \"p4 configure set run.move.allow=1\" &&\n+\tp4 configure set run.move.allow=0 &&\n+\t(\n+\t\tcd \"$cli\" &&\n+\t\techo move-disallow-file >move-disallow-file &&\n+\t\tp4 add move-disallow-file &&\n+\t\tp4 submit -d \"add move-disallow-file\"\n+\t) &&\n+\ttest_when_finished cleanup_git &&\n+\tgit p4 clone --dest=\"$git\" //depot &&\n+\t(\n+\t\tcd \"$git\" &&\n+\t\tgit config git-p4.skipSubmitEdit true &&\n+\t\tgit config git-p4.detectRenames true &&\n+\t\tgit mv move-disallow-file move-disallow-file-moved &&\n+\t\tgit commit -m \"move move-disallow-file\" &&\n+\t\tgit p4 submit\n+\t)\n+'\n+\n test_expect_success 'kill p4d' '\n \tkill_p4d\n '\n-- \n1.7.12.1.457.g468b3ef\n"}]}