]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Inform user about current branch in diff
authorvrana <jakubv@fb.com>
Fri, 25 May 2012 00:48:56 +0000 (17:48 -0700)
committervrana <jakubv@fb.com>
Fri, 25 May 2012 01:13:18 +0000 (18:13 -0700)
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

src/workflow/diff/ArcanistDiffWorkflow.php

index 523336517f6b3711eecfe8ea3123b965a350e21b..b6935431672327542c5df311fe1652ebb284ebb3 100644 (file)
@@ -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".