{"thread":{"id":"16656","subject":"[PATCH] git-p4: Fix regression in p4Where method.","startedAt":"2008-12-09T15:41:50Z","lastAt":"2008-12-09T15:41:50Z","messageCount":1,"participants":["Tor Arvid Lund"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"97437","messageId":"1228837310-1340-1-git-send-email-torarvid@gmail.com","threadId":"16656","inReplyTo":null,"subject":"[PATCH] git-p4: Fix regression in p4Where method.","fromName":"Tor Arvid Lund","fromEmail":"torarvid@gmail.com","sentAt":"2008-12-09T15:41:50Z","receivedAt":"2008-12-09T15:41:50Z","isPatch":true,"sender":{"key":"torarvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/439758?v=4"},"body":"Unfortunately, I introduced a bug in commit 7f705dc36 (git-p4: Fix bug in\np4Where method). This happens because sometimes the result from\n\"p4 where <somepath>\" doesn't contain a \"depotFile\" key, but instead a\n\"data\" key that needs further parsing. This commit should ensure that both\nof these cases are checked.\n\nSigned-off-by: Tor Arvid Lund <torarvid@gmail.com>\n---\n contrib/fast-import/git-p4 |   13 ++++++++++---\n 1 files changed, 10 insertions(+), 3 deletions(-)\n\ndiff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\nindex ee504e9..a85a7b2 100755\n--- a/contrib/fast-import/git-p4\n+++ b/contrib/fast-import/git-p4\n@@ -249,9 +249,16 @@ def p4Where(depotPath):\n     outputList = p4CmdList(\"where %s\" % depotPath)\n     output = None\n     for entry in outputList:\n-        if entry[\"depotFile\"] == depotPath:\n-            output = entry\n-            break\n+        if \"depotFile\" in entry:\n+            if entry[\"depotFile\"] == depotPath:\n+                output = entry\n+                break\n+        elif \"data\" in entry:\n+            data = entry.get(\"data\")\n+            space = data.find(\" \")\n+            if data[:space] == depotPath:\n+                output = entry\n+                break\n     if output == None:\n         return \"\"\n     if output[\"code\"] == \"error\":\n-- \n1.6.0.2.1172.ga5ed0\n"}]}