]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Support "D123", not just "123", for "arc export --revision"
authorepriestley <git@epriestley.com>
Thu, 28 Jun 2012 01:33:28 +0000 (18:33 -0700)
committerepriestley <git@epriestley.com>
Thu, 28 Jun 2012 01:33:28 +0000 (18:33 -0700)
Summary: We currently error if a user types "--revision D123".

Test Plan: `arc export --git --revision D123`, got a diff.

Reviewers: vrana, jungejason

Reviewed By: vrana

CC: aran
Differential Revision: https://secure.phabricator.com/D2880

src/workflow/ArcanistExportWorkflow.php

index 7e0aa49771968382b629ef4ffc58c0290413a845..0e9afb5afa1d3974730159554f49c4dfcf034789 100644 (file)
@@ -103,11 +103,17 @@ EOTEXT
     if ($this->getArgument('revision')) {
       $source = self::SOURCE_REVISION;
       $requested++;
+
+      $source_id = $this->getArgument($source);
+      $this->sourceID = $this->normalizeRevisionID($source_id);
     }
     if ($this->getArgument('diff')) {
       $source = self::SOURCE_DIFF;
       $requested++;
+
+      $this->sourceID = $this->getArgument($source);
     }
+    $this->source = $source;
 
     if ($requested > 1) {
       throw new ArcanistUsageException(
@@ -115,8 +121,6 @@ EOTEXT
       "one change source.");
     }
 
-    $this->source = $source;
-    $this->sourceID = $this->getArgument($source);
 
     $format = null;
     $requested = 0;