From: Bob Trahan Date: Thu, 1 Nov 2012 23:47:08 +0000 (-0700) Subject: modify arc diff workflow to only do amend optimization if git repository X-Git-Tag: conduit-6~45 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=027483f29a3b1df7850afe42c2718eabb583aa19;p=arcanist.git modify arc diff workflow to only do amend optimization if git repository Summary: fix for T2011, first option in list of possible fixes Test Plan: ...do I really have to setup mercurial with mq? :D Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T2011 Differential Revision: https://secure.phabricator.com/D3869 --- diff --git a/src/workflow/ArcanistDiffWorkflow.php b/src/workflow/ArcanistDiffWorkflow.php index bfa161ac..eef46422 100644 --- a/src/workflow/ArcanistDiffWorkflow.php +++ b/src/workflow/ArcanistDiffWorkflow.php @@ -1616,8 +1616,13 @@ EOTEXT $template = ArcanistCommentRemover::removeComments($new_template); $repository_api = $this->getRepositoryAPI(); - $should_amend = (count($included_commits) == 1 && $this->shouldAmend()); - if ($should_amend && $repository_api->supportsAmend()) { + // special check for whether to amend here. optimizes a common git + // workflow. we can't do this for mercurial because the mq extension + // is popular and incompatible with hg commit --amend ; see T2011. + $should_amend = (count($included_commits) == 1 && + $repository_api instanceof ArcanistGitAPI && + $this->shouldAmend()); + if ($should_amend) { $repository_api->amendCommit($template); $wrote = true; $where = 'commit message';