From b713eb51c978cf613550219ed764493f4338af0c Mon Sep 17 00:00:00 2001 From: durham Date: Mon, 17 Jun 2013 11:40:58 -0700 Subject: [PATCH] Don't prepopulate update message in hg amend diff workflow Summary: Previously, updating a commit via arc diff in mercurial would prepopulate the update message with part of the commit message. In an amend workflow this doesn't make sense, so I disabled it. Git already does this, so now mercurial matches git in this scenario. We had users complain that new users would often submit diffs with the default update message, and it wasn't useful since they were using a amend flow. Test Plan: arc diff on a commit that already had a diff Verified the editor did not have a update message arc diff on a stack of commits where the bottom one had a diff Verified the editor provided a default update message Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D6215 --- src/workflow/ArcanistDiffWorkflow.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/workflow/ArcanistDiffWorkflow.php b/src/workflow/ArcanistDiffWorkflow.php index 84f29b7b..47970967 100644 --- a/src/workflow/ArcanistDiffWorkflow.php +++ b/src/workflow/ArcanistDiffWorkflow.php @@ -2104,6 +2104,12 @@ EOTEXT $messages = $repository_api->getCommitMessageLog(); + if (count($messages) == 1) { + // If there's only one message, assume this is an amend-based workflow and + // that using it to prefill doesn't make sense. + return null; + } + $local = $this->loadActiveLocalCommitInfo(); $hashes = ipull($local, null, 'commit');