Page MenuHomePhabricator

D15759.diff
No OneTemporary

D15759.diff

diff --git a/resources/sql/autopatches/20160419.pushlog.1.sql b/resources/sql/autopatches/20160419.pushlog.1.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20160419.pushlog.1.sql
@@ -0,0 +1,2 @@
+ALTER TABLE {$NAMESPACE}_repository.repository_pushlog
+ ADD devicePHID VARBINARY(64);
diff --git a/src/applications/diffusion/engine/DiffusionCommitHookEngine.php b/src/applications/diffusion/engine/DiffusionCommitHookEngine.php
--- a/src/applications/diffusion/engine/DiffusionCommitHookEngine.php
+++ b/src/applications/diffusion/engine/DiffusionCommitHookEngine.php
@@ -1058,8 +1058,16 @@
// up.
$phid = id(new PhabricatorRepositoryPushLog())->generatePHID();
+ $device = AlmanacKeys::getLiveDevice();
+ if ($device) {
+ $device_phid = $device->getPHID();
+ } else {
+ $device_phid = null;
+ }
+
return PhabricatorRepositoryPushLog::initializeNewLog($this->getViewer())
->setPHID($phid)
+ ->setDevicePHID($device_phid)
->setRepositoryPHID($this->getRepository()->getPHID())
->attachRepository($this->getRepository())
->setEpoch(time());
diff --git a/src/applications/diffusion/view/DiffusionPushLogListView.php b/src/applications/diffusion/view/DiffusionPushLogListView.php
--- a/src/applications/diffusion/view/DiffusionPushLogListView.php
+++ b/src/applications/diffusion/view/DiffusionPushLogListView.php
@@ -38,6 +38,7 @@
}
$rows = array();
+ $any_host = false;
foreach ($logs as $log) {
$repository = $log->getRepository();
@@ -59,6 +60,14 @@
$log->getRefOldShort());
}
+ $device_phid = $log->getDevicePHID();
+ if ($device_phid) {
+ $device = $handles[$device_phid]->renderLink();
+ $any_host = true;
+ } else {
+ $device = null;
+ }
+
$rows[] = array(
phutil_tag(
'a',
@@ -75,6 +84,7 @@
$handles[$log->getPusherPHID()]->renderLink(),
$remote_address,
$log->getPushEvent()->getRemoteProtocol(),
+ $device,
$log->getRefType(),
$log->getRefName(),
$old_ref_link,
@@ -100,6 +110,7 @@
pht('Pusher'),
pht('From'),
pht('Via'),
+ pht('Host'),
pht('Type'),
pht('Name'),
pht('Old'),
@@ -116,10 +127,20 @@
'',
'',
'',
+ '',
'wide',
'n',
'n',
'right',
+ ))
+ ->setColumnVisibility(
+ array(
+ true,
+ true,
+ true,
+ true,
+ true,
+ $any_host,
));
return $table;
diff --git a/src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php b/src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php
--- a/src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php
+++ b/src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php
@@ -95,7 +95,12 @@
protected function getRequiredHandlePHIDsForResultList(
array $logs,
PhabricatorSavedQuery $query) {
- return mpull($logs, 'getPusherPHID');
+ $phids = array();
+ $phids[] = mpull($logs, 'getPusherPHID');
+ $phids[] = mpull($logs, 'getDevicePHID');
+ $phids = array_mergev($phids);
+ $phids = array_filter($phids);
+ return $phids;
}
protected function renderResultList(
diff --git a/src/applications/repository/storage/PhabricatorRepositoryPushLog.php b/src/applications/repository/storage/PhabricatorRepositoryPushLog.php
--- a/src/applications/repository/storage/PhabricatorRepositoryPushLog.php
+++ b/src/applications/repository/storage/PhabricatorRepositoryPushLog.php
@@ -34,6 +34,7 @@
protected $epoch;
protected $pusherPHID;
protected $pushEventPHID;
+ protected $devicePHID;
protected $refType;
protected $refNameHash;
protected $refNameRaw;
@@ -81,6 +82,7 @@
'refNew' => 'text40',
'mergeBase' => 'text40?',
'changeFlags' => 'uint32',
+ 'devicePHID' => 'phid?',
),
self::CONFIG_KEY_SCHEMA => array(
'key_repository' => array(

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 7, 1:50 AM (1 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6761217
Default Alt Text
D15759.diff (4 KB)

Event Timeline