Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13976419
D11554.id27897.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D11554.id27897.diff
View Options
diff --git a/src/workflow/ArcanistUpgradeWorkflow.php b/src/workflow/ArcanistUpgradeWorkflow.php
--- a/src/workflow/ArcanistUpgradeWorkflow.php
+++ b/src/workflow/ArcanistUpgradeWorkflow.php
@@ -24,43 +24,48 @@
);
}
- public function getArguments() {
- return array();
- }
-
public function run() {
- $roots = array();
- $roots['libphutil'] = dirname(phutil_get_library_root('phutil'));
- $roots['arcanist'] = dirname(phutil_get_library_root('arcanist'));
+ $roots = array(
+ 'libphutil' => dirname(phutil_get_library_root('phutil')),
+ 'arcanist' => dirname(phutil_get_library_root('arcanist')),
+ );
foreach ($roots as $lib => $root) {
- echo "Upgrading {$lib}...\n";
-
- if (!Filesystem::pathExists($root.'/.git')) {
- throw new ArcanistUsageException(
- "{$lib} must be in its git working copy to be automatically ".
- "upgraded. This copy of {$lib} (in '{$root}') is not in a git ".
- "working copy.");
- }
+ echo pht('Upgrading %s...', $lib)."\n";
$working_copy = ArcanistWorkingCopyIdentity::newFromPath($root);
-
$configuration_manager = clone $this->getConfigurationManager();
$configuration_manager->setWorkingCopyIdentity($working_copy);
- $repository_api = ArcanistRepositoryAPI::newAPIFromConfigurationManager(
+ $repository = ArcanistRepositoryAPI::newAPIFromConfigurationManager(
$configuration_manager);
- $this->setRepositoryAPI($repository_api);
+ if (!Filesystem::pathExists($repository->getMetadataPath())) {
+ throw new ArcanistUsageException(
+ pht(
+ "%s must be in its git working copy to be automatically upgraded. ".
+ "This copy of %s (in '%s') is not in a git working copy.",
+ $lib,
+ $lib,
+ $root));
+ }
+
+ $this->setRepositoryAPI($repository);
// Require no local changes.
$this->requireCleanWorkingCopy();
// Require the library be on master.
- $branch_name = $repository_api->getBranchName();
+ $branch_name = $repository->getBranchName();
if ($branch_name != 'master') {
throw new ArcanistUsageException(
- "{$lib} must be on branch 'master' to be automatically upgraded. ".
- "This copy of {$lib} (in '{$root}') is on branch '{$branch_name}'.");
+ pht(
+ "%s must be on branch '%s' to be automatically upgraded. ".
+ "This copy of %s (in '%s') is on branch '%s'.",
+ $lib,
+ 'master',
+ $lib,
+ $root,
+ $branch_name));
}
chdir($root);
@@ -72,10 +77,10 @@
}
}
- echo phutil_console_wrap(
- phutil_console_format(
- "**Updated!** Your copy of arc is now up to date.\n"));
-
+ echo phutil_console_format(
+ "**%s** %s\n",
+ pht('Updated!'),
+ pht('Your copy of arc is now up to date.'));
return 0;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 19, 2:10 PM (3 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6723319
Default Alt Text
D11554.id27897.diff (2 KB)
Attached To
Mode
D11554: Minor tidying of `ArcanistUpgradeWorkflow`
Attached
Detach File
Event Timeline
Log In to Comment