]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Some mercurial parsing fixes
authorepriestley <git@epriestley.com>
Wed, 31 Aug 2011 18:51:56 +0000 (11:51 -0700)
committerepriestley <git@epriestley.com>
Wed, 14 Sep 2011 14:19:00 +0000 (07:19 -0700)
Summary: Parse some other fields which I hadn't seen yet from "hg log". Select
the right "hg log" range for local commit info.

Test Plan: Ran "arc diff" in my test mercurial repository from a branch with
tags. Looked at "local commits" in Differential.

Reviewers: Makinde, aran, jungejason, tuomaspelkonen

Reviewed By: Makinde

CC: aran, Makinde
Differential Revision: 880

src/repository/api/mercurial/ArcanistMercurialAPI.php

index d9de1a1bc35168ac19868cd48d915b85b0288fcf..0891313f6816e33b02e7ca678b668a87b6a31125 100644 (file)
@@ -88,7 +88,13 @@ class ArcanistMercurialAPI extends ArcanistRepositoryAPI {
       $this->getPath(),
       $this->getRelativeCommit(),
       'tip');
-    return $this->parseMercurialLog($info);
+    $logs = $this->parseMercurialLog($info);
+
+    // Get rid of the first log, it's not actually part of the diff. "hg log"
+    // is inclusive, while "hg diff" is exclusive.
+    array_shift($logs);
+
+    return $logs;
   }
 
 
@@ -304,6 +310,12 @@ class ArcanistMercurialAPI extends ArcanistRepositoryAPI {
               'rev'   => $rev,
             );
             break;
+          case 'branch':
+            $commit['branch'] = $value;
+            break;
+          case 'tag':
+            $commit['tag'] = $value;
+            break;
           default:
             throw new Exception("Unknown Mercurial log field '{$name}'!");
         }