]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Provide a method for getting Git SVN revision
authorvrana <jakubv@fb.com>
Fri, 30 Nov 2012 01:40:07 +0000 (17:40 -0800)
committervrana <jakubv@fb.com>
Fri, 30 Nov 2012 19:06:23 +0000 (11:06 -0800)
Summary: I plan to use it in `save_lint.php`.

Test Plan:
  $api->getUnderlyingWorkingCopyRevision(); // In Git SVN repo

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4054

src/repository/api/ArcanistGitAPI.php
src/repository/api/ArcanistRepositoryAPI.php

index b7a045cb2a4ef0295ece95f7c6ae7cee6f65e826..8e3b8065dae713d02b78e67c09fa906589e64613 100644 (file)
@@ -702,6 +702,14 @@ final class ArcanistGitAPI extends ArcanistRepositoryAPI {
     return rtrim($stdout, "\n");
   }
 
+  public function getUnderlyingWorkingCopyRevision() {
+    list($err, $stdout) = $this->execManualLocal('svn find-rev HEAD');
+    if (!$err && $stdout) {
+      return rtrim($stdout, "\n");
+    }
+    return $this->getWorkingCopyRevision();
+  }
+
   public function isHistoryDefaultImmutable() {
     return false;
   }
index 82f9fdcbb698f7cdfba03e1e70b11ed56f77a86e..0e4334e5e78317cae294f118315b4cbd2326c5c9 100644 (file)
@@ -173,6 +173,10 @@ abstract class ArcanistRepositoryAPI {
     ConduitClient $conduit,
     array $query);
 
+  public function getUnderlyingWorkingCopyRevision() {
+    return $this->getWorkingCopyRevision();
+  }
+
   /**
    * Set the base commit to a reasonable default value so that working copy
    * status checks can do something meaningful and won't invoke configured