1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 14:52:40 +01:00

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
This commit is contained in:
epriestley 2012-03-05 10:08:50 -08:00
parent 64ada40f03
commit ba21708513

View file

@ -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();