Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15345032
D14610.id35345.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
D14610.id35345.diff
View Options
diff --git a/src/applications/config/module/PhabricatorConfigVersionsModule.php b/src/applications/config/module/PhabricatorConfigVersionsModule.php
--- a/src/applications/config/module/PhabricatorConfigVersionsModule.php
+++ b/src/applications/config/module/PhabricatorConfigVersionsModule.php
@@ -14,13 +14,11 @@
public function renderModuleStatus(AphrontRequest $request) {
$viewer = $request->getViewer();
-
- $versions = $this->loadVersions();
+ $versions = $this->loadVersions($viewer);
$version_property_list = id(new PHUIPropertyListView());
- foreach ($versions as $version) {
- list($name, $hash) = $version;
- $version_property_list->addProperty($name, $hash);
+ foreach ($versions as $name => $version) {
+ $version_property_list->addProperty($name, $version);
}
$object_box = id(new PHUIObjectBoxView())
@@ -39,26 +37,23 @@
return $object_box;
}
- private function loadVersions() {
+ private function loadVersions(PhabricatorUser $viewer) {
$specs = array(
- array(
- 'name' => pht('Phabricator Version'),
- 'root' => 'phabricator',
- ),
- array(
- 'name' => pht('Arcanist Version'),
- 'root' => 'arcanist',
- ),
- array(
- 'name' => pht('libphutil Version'),
- 'root' => 'phutil',
- ),
+ 'phabricator',
+ 'arcanist',
+ 'phutil',
);
+ $all_libraries = PhutilBootloader::getInstance()->getAllLibraries();
+ $other_libraries = array_diff($all_libraries, ipull($specs, 'lib'));
+ $specs = $specs + $other_libraries;
+
+
$futures = array();
- foreach ($specs as $key => $spec) {
- $root = dirname(phutil_get_library_root($spec['root']));
- $futures[$key] = id(new ExecFuture('git log --format=%%H -n 1 --'))
+ foreach ($specs as $lib) {
+ $root = dirname(phutil_get_library_root($lib));
+ $futures[$lib] =
+ id(new ExecFuture('git log --format=%s -n 1 --', '%H %ct'))
->setCWD($root);
}
@@ -66,14 +61,15 @@
foreach ($futures as $key => $future) {
list($err, $stdout) = $future->resolve();
if (!$err) {
- $name = trim($stdout);
+ list($hash, $epoch) = explode(' ', $stdout);
+ $version = pht('%s (%s)', $hash, phabricator_date($epoch, $viewer));
} else {
- $name = pht('Unknown');
+ $version = pht('Unknown');
}
- $results[$key] = array($specs[$key]['name'], $name);
+ $results[$key] = $version;
}
- return array_select_keys($results, array_keys($specs));
+ return $results;
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 11, 8:13 AM (1 d, 7 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7511727
Default Alt Text
D14610.id35345.diff (2 KB)
Attached To
Mode
D14610: Versions Panel: Show extensions, dates
Attached
Detach File
Event Timeline
Log In to Comment