]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Don't prepopulate update message in hg amend diff workflow
authordurham <durham@fb.com>
Mon, 17 Jun 2013 18:40:58 +0000 (11:40 -0700)
committerdurham <durham@fb.com>
Mon, 17 Jun 2013 18:40:58 +0000 (11:40 -0700)
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

index 84f29b7b514b2c30975fadfde549d32d02023528..479709676b746b9389f613cf0e561ed96aa982f6 100644 (file)
@@ -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');