Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/applications/diffusion/controller/DiffusionPullLogListController.php b/src/applications/diffusion/controller/DiffusionPullLogListController.php
index 29712be2a4..f3b570c815 100644
--- a/src/applications/diffusion/controller/DiffusionPullLogListController.php
+++ b/src/applications/diffusion/controller/DiffusionPullLogListController.php
@@ -1,12 +1,17 @@
<?php
final class DiffusionPullLogListController
extends DiffusionLogController {
public function handleRequest(AphrontRequest $request) {
return id(new DiffusionPullLogSearchEngine())
->setController($this)
->buildResponse();
}
+ protected function buildApplicationCrumbs() {
+ return parent::buildApplicationCrumbs()
+ ->addTextCrumb(pht('Pull Logs'), $this->getApplicationURI('pulllog/'));
+ }
+
}
diff --git a/src/applications/diffusion/controller/DiffusionPushLogListController.php b/src/applications/diffusion/controller/DiffusionPushLogListController.php
index 658e21674d..a6c612eebe 100644
--- a/src/applications/diffusion/controller/DiffusionPushLogListController.php
+++ b/src/applications/diffusion/controller/DiffusionPushLogListController.php
@@ -1,12 +1,17 @@
<?php
final class DiffusionPushLogListController
extends DiffusionLogController {
public function handleRequest(AphrontRequest $request) {
return id(new PhabricatorRepositoryPushLogSearchEngine())
->setController($this)
->buildResponse();
}
+ protected function buildApplicationCrumbs() {
+ return parent::buildApplicationCrumbs()
+ ->addTextCrumb(pht('Push Logs'), $this->getApplicationURI('pushlog/'));
+ }
+
}
diff --git a/src/applications/diffusion/view/DiffusionPushLogListView.php b/src/applications/diffusion/view/DiffusionPushLogListView.php
index 77f28671c6..e101625752 100644
--- a/src/applications/diffusion/view/DiffusionPushLogListView.php
+++ b/src/applications/diffusion/view/DiffusionPushLogListView.php
@@ -1,140 +1,160 @@
<?php
final class DiffusionPushLogListView extends AphrontView {
private $logs;
public function setLogs(array $logs) {
assert_instances_of($logs, 'PhabricatorRepositoryPushLog');
$this->logs = $logs;
return $this;
}
public function render() {
$logs = $this->logs;
$viewer = $this->getViewer();
$handle_phids = array();
foreach ($logs as $log) {
$handle_phids[] = $log->getPusherPHID();
$device_phid = $log->getDevicePHID();
if ($device_phid) {
$handle_phids[] = $device_phid;
}
}
$handles = $viewer->loadHandles($handle_phids);
// Only administrators can view remote addresses.
$remotes_visible = $viewer->getIsAdmin();
+ $flag_map = PhabricatorRepositoryPushLog::getFlagDisplayNames();
+ $reject_map = PhabricatorRepositoryPushLog::getRejectCodeDisplayNames();
+
$rows = array();
$any_host = false;
foreach ($logs as $log) {
$repository = $log->getRepository();
if ($remotes_visible) {
$remote_address = $log->getPushEvent()->getRemoteAddress();
} else {
$remote_address = null;
}
$event_id = $log->getPushEvent()->getID();
$old_ref_link = null;
if ($log->getRefOld() != DiffusionCommitHookEngine::EMPTY_HASH) {
$old_ref_link = phutil_tag(
'a',
array(
'href' => $repository->getCommitURI($log->getRefOld()),
),
$log->getRefOldShort());
}
$device_phid = $log->getDevicePHID();
if ($device_phid) {
$device = $viewer->renderHandle($device_phid);
$any_host = true;
} else {
$device = null;
}
+ $flags = $log->getChangeFlags();
+ $flag_names = array();
+ foreach ($flag_map as $flag_key => $flag_name) {
+ if (($flags & $flag_key) === $flag_key) {
+ $flag_names[] = $flag_name;
+ }
+ }
+ $flag_names = phutil_implode_html(
+ phutil_tag('br'),
+ $flag_names);
+
+ $reject_code = $log->getPushEvent()->getRejectCode();
+ $reject_label = idx(
+ $reject_map,
+ $reject_code,
+ pht('Unknown ("%s")', $reject_code));
+
$rows[] = array(
phutil_tag(
'a',
array(
'href' => '/diffusion/pushlog/view/'.$event_id.'/',
),
$event_id),
phutil_tag(
'a',
array(
'href' => $repository->getURI(),
),
$repository->getDisplayName()),
$viewer->renderHandle($log->getPusherPHID()),
$remote_address,
$log->getPushEvent()->getRemoteProtocol(),
$device,
$log->getRefType(),
$log->getRefName(),
$old_ref_link,
phutil_tag(
'a',
array(
'href' => $repository->getCommitURI($log->getRefNew()),
),
$log->getRefNewShort()),
-
- // TODO: Make these human-readable.
- $log->getChangeFlags(),
- $log->getPushEvent()->getRejectCode(),
+ $flag_names,
+ $reject_label,
$viewer->formatShortDateTime($log->getEpoch()),
);
}
$table = id(new AphrontTableView($rows))
->setHeaders(
array(
pht('Push'),
pht('Repository'),
pht('Pusher'),
pht('From'),
pht('Via'),
pht('Host'),
pht('Type'),
pht('Name'),
pht('Old'),
pht('New'),
pht('Flags'),
- pht('Code'),
+ pht('Result'),
pht('Date'),
))
->setColumnClasses(
array(
'',
'',
'',
'',
'',
'',
'',
'wide',
'n',
'n',
+ '',
+ '',
'right',
))
->setColumnVisibility(
array(
true,
true,
true,
$remotes_visible,
true,
$any_host,
));
return $table;
}
}

File Metadata

Mime Type
text/x-diff
Expires
Mon, Apr 28, 10:43 AM (16 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
107930
Default Alt Text
(5 KB)

Event Timeline