From: epriestley Date: Mon, 5 Mar 2012 18:08:50 +0000 (-0800) Subject: Make "arc diff --raw -C HEAD" work correctly X-Git-Tag: conduit-4~125 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=ba21708513224ae5a46227d7e621933efd16762a;p=arcanist.git Make "arc diff --raw -C HEAD" work correctly Summary: There's no reason this can't work now, we're just not quite careful enough about definitions. NOTE: If you use a message which has a revision ID in it already, this will fail in an obtuse way when launching the update editor fails because stdin isn't a tty. I'll clean this all up after T614 is fully sorted. Test Plan: Ran "arc diff --raw -C HEAD". Reviewers: btrahan, yairlivne Reviewed By: btrahan CC: aran, epriestley Differential Revision: https://secure.phabricator.com/D1765 --- diff --git a/src/workflow/diff/ArcanistDiffWorkflow.php b/src/workflow/diff/ArcanistDiffWorkflow.php index b650868e..bfae80aa 100644 --- a/src/workflow/diff/ArcanistDiffWorkflow.php +++ b/src/workflow/diff/ArcanistDiffWorkflow.php @@ -73,7 +73,15 @@ EOTEXT } public function requiresRepositoryAPI() { - return !$this->isRawDiffSource(); + if (!$this->isRawDiffSource()) { + return true; + } + + if ($this->getArgument('use-commit-message')) { + return true; + } + + return false; } public function getDiffID() { @@ -451,7 +459,7 @@ EOTEXT 'revision_id' => $result['revisionid'], )); - if ($this->requiresRepositoryAPI()) { + if (!$this->isRawDiffSource()) { $repository_api = $this->getRepositoryAPI(); if (($repository_api instanceof ArcanistGitAPI) && $this->shouldAmend()) { @@ -1621,7 +1629,7 @@ EOTEXT private function getDefaultCreateFields() { $empty = array(array(), array()); - if (!$this->requiresRepositoryAPI()) { + if ($this->isRawDiffSource()) { return $empty; } @@ -1669,7 +1677,7 @@ EOTEXT } private function getDefaultUpdateMessage() { - if (!$this->requiresRepositoryAPI()) { + if ($this->isRawDiffSource()) { return null; } @@ -1857,7 +1865,7 @@ EOTEXT $source_path = null; $branch = null; - if ($this->requiresRepositoryAPI()) { + if (!$this->isRawDiffSource()) { $repository_api = $this->getRepositoryAPI(); $base_revision = $repository_api->getSourceControlBaseRevision();