From: vrana Date: Fri, 25 May 2012 00:48:56 +0000 (-0700) Subject: Inform user about current branch in diff X-Git-Tag: conduit-6~303 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=a0894840425d18f8bef3c47976b26ea5ace021bd;p=arcanist.git Inform user about current branch in diff Summary: I am trying to stop using `--verbatim` and miss this information. Test Plan: This diff. Reviewers: epriestley Reviewed By: epriestley CC: aran, Koolvin Differential Revision: https://secure.phabricator.com/D2575 --- diff --git a/src/workflow/diff/ArcanistDiffWorkflow.php b/src/workflow/diff/ArcanistDiffWorkflow.php index 52333651..b6935431 100644 --- a/src/workflow/diff/ArcanistDiffWorkflow.php +++ b/src/workflow/diff/ArcanistDiffWorkflow.php @@ -449,7 +449,7 @@ EOTEXT $revision['id'] = $message->getRevisionID(); $this->revisionID = $revision['id']; - $update_message = $this->getUpdateMessage(); + $update_message = $this->getUpdateMessage($revision['fields']); $revision['message'] = $update_message; $future = $conduit->callMethod( @@ -1389,10 +1389,14 @@ EOTEXT foreach ($included as $k => $commit) { $included[$k] = ' '.$commit; } + $in_branch = ''; + if (!$this->isRawDiffSource()) { + $in_branch = ' in branch '.$this->getRepositoryAPI()->getBranchName(); + } $included = array_merge( array( "", - "Included commits:", + "Included commits{$in_branch}:", "", ), $included, @@ -1583,7 +1587,7 @@ EOTEXT /** * @task message */ - private function getUpdateMessage() { + private function getUpdateMessage(array $fields) { $comments = $this->getArgument('message'); if (strlen($comments)) { return $comments; @@ -1611,6 +1615,8 @@ EOTEXT $template = rtrim($comments). "\n\n". + "# Updating D{$fields['revisionID']}: {$fields['title']}\n". + "#\n". "# Enter a brief description of the changes included in this update.\n". "# The first line is used as subject, next lines as comment.\n". "#\n".