]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Fix some format strings
authorJoshua Spence <josh@joshuaspence.com>
Mon, 25 May 2015 11:20:43 +0000 (21:20 +1000)
committerJoshua Spence <josh@joshuaspence.com>
Mon, 25 May 2015 11:24:40 +0000 (21:24 +1000)
Summary: These `pht` calls use `%d` instead of `%s`.

Test Plan: Eyeball it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D12994

src/workflow/ArcanistDiffWorkflow.php
src/workflow/ArcanistDownloadWorkflow.php

index db1ad23d52ea86979e3e278396dd475b9a0a7f5a..ded017b4d47d9309f4fe704cdf46c7714ed005b5 100644 (file)
@@ -946,17 +946,15 @@ EOTEXT
     }
 
     if (count($changes) > 250) {
-      $count = number_format(count($changes));
-      $link =
-        'http://www.phabricator.com/docs/phabricator/article/'.
-        'Differential_User_Guide_Large_Changes.html';
       $message = pht(
-        'This diff has a very large number of changes (%d). Differential '.
+        'This diff has a very large number of changes (%s). Differential '.
         'works best for changes which will receive detailed human review, '.
         'and not as well for large automated changes or bulk checkins. '.
         'See %s for information about reviewing big checkins. Continue anyway?',
-        $count,
-        $link);
+        new PhutilNumber(count($changes)),
+        'http://www.phabricator.com/docs/phabricator/article/'.
+        'Differential_User_Guide_Large_Changes.html');
+
       if (!phutil_console_confirm($message)) {
         throw new ArcanistUsageException(
           pht('Aborted generation of gigantic diff.'));
@@ -970,13 +968,11 @@ EOTEXT
         $size += strlen($hunk->getCorpus());
       }
       if ($size > $limit) {
-        $file_name = $change->getCurrentPath();
-        $change_size = number_format($size);
         $byte_warning = pht(
-          "Diff for '%s' with context is %d bytes in length. ".
+          "Diff for '%s' with context is %s bytes in length. ".
           "Generally, source changes should not be this large.",
-          $file_name,
-          $change_size);
+          $change->getCurrentPath(),
+          new PhutilNumber($size));
         if (!$this->getArgument('less-context')) {
           $byte_warning .= ' '.pht(
             "If this file is a huge text file, try using the '%s' flag.",
index 56ea3a22aa9cadfab5f6a95988322d7c8691873d..f3eb466b75c800234e85b8a9e5408699eec928ef 100644 (file)
@@ -86,8 +86,7 @@ EOTEXT
         'id' => $this->id,
       ));
 
-    $bytes = number_format($info['byteSize']);
-    $desc = pht('(%d bytes)', $bytes);
+    $desc = pht('(%s bytes)', new PhutilNumber($info['byteSize']));
     if ($info['name']) {
       $desc = "'".$info['name']."' ".$desc;
     }