@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Versions Panel: Show extensions, dates

Summary: ref T9788

Test Plan: {F1008540}

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T9788

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

authored by

Aviv Eyal and committed by
avivey
2fba7e66 065df01f

+21 -25
+21 -25
src/applications/config/module/PhabricatorConfigVersionsModule.php
··· 14 14 public function renderModuleStatus(AphrontRequest $request) { 15 15 $viewer = $request->getViewer(); 16 16 17 - 18 - $versions = $this->loadVersions(); 17 + $versions = $this->loadVersions($viewer); 19 18 20 19 $version_property_list = id(new PHUIPropertyListView()); 21 - foreach ($versions as $version) { 22 - list($name, $hash) = $version; 23 - $version_property_list->addProperty($name, $hash); 20 + foreach ($versions as $name => $version) { 21 + $version_property_list->addProperty($name, $version); 24 22 } 25 23 26 24 $object_box = id(new PHUIObjectBoxView()) ··· 39 37 return $object_box; 40 38 } 41 39 42 - private function loadVersions() { 40 + private function loadVersions(PhabricatorUser $viewer) { 43 41 $specs = array( 44 - array( 45 - 'name' => pht('Phabricator Version'), 46 - 'root' => 'phabricator', 47 - ), 48 - array( 49 - 'name' => pht('Arcanist Version'), 50 - 'root' => 'arcanist', 51 - ), 52 - array( 53 - 'name' => pht('libphutil Version'), 54 - 'root' => 'phutil', 55 - ), 42 + 'phabricator', 43 + 'arcanist', 44 + 'phutil', 56 45 ); 57 46 47 + $all_libraries = PhutilBootloader::getInstance()->getAllLibraries(); 48 + $other_libraries = array_diff($all_libraries, ipull($specs, 'lib')); 49 + $specs = $specs + $other_libraries; 50 + 51 + 58 52 $futures = array(); 59 - foreach ($specs as $key => $spec) { 60 - $root = dirname(phutil_get_library_root($spec['root'])); 61 - $futures[$key] = id(new ExecFuture('git log --format=%%H -n 1 --')) 53 + foreach ($specs as $lib) { 54 + $root = dirname(phutil_get_library_root($lib)); 55 + $futures[$lib] = 56 + id(new ExecFuture('git log --format=%s -n 1 --', '%H %ct')) 62 57 ->setCWD($root); 63 58 } 64 59 ··· 66 61 foreach ($futures as $key => $future) { 67 62 list($err, $stdout) = $future->resolve(); 68 63 if (!$err) { 69 - $name = trim($stdout); 64 + list($hash, $epoch) = explode(' ', $stdout); 65 + $version = pht('%s (%s)', $hash, phabricator_date($epoch, $viewer)); 70 66 } else { 71 - $name = pht('Unknown'); 67 + $version = pht('Unknown'); 72 68 } 73 - $results[$key] = array($specs[$key]['name'], $name); 69 + $results[$key] = $version; 74 70 } 75 71 76 - return array_select_keys($results, array_keys($specs)); 72 + return $results; 77 73 } 78 74 79 75 }