Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15458891
D18113.id43573.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
14 KB
Referenced Files
None
Subscribers
None
D18113.id43573.diff
View Options
diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -71,7 +71,7 @@
'rsrc/css/application/differential/revision-history.css' => '0e8eb855',
'rsrc/css/application/differential/revision-list.css' => 'f3c47d33',
'rsrc/css/application/differential/table-of-contents.css' => 'ae4b7a55',
- 'rsrc/css/application/diffusion/diffusion-history.css' => '6870e8c1',
+ 'rsrc/css/application/diffusion/diffusion-history.css' => '4540f568',
'rsrc/css/application/diffusion/diffusion-icons.css' => 'a6a1e2ba',
'rsrc/css/application/diffusion/diffusion-readme.css' => '419dd5b6',
'rsrc/css/application/diffusion/diffusion-source.css' => '750add59',
@@ -569,7 +569,7 @@
'differential-revision-history-css' => '0e8eb855',
'differential-revision-list-css' => 'f3c47d33',
'differential-table-of-contents-css' => 'ae4b7a55',
- 'diffusion-history-css' => '6870e8c1',
+ 'diffusion-history-css' => '4540f568',
'diffusion-icons-css' => 'a6a1e2ba',
'diffusion-readme-css' => '419dd5b6',
'diffusion-source-css' => '750add59',
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -612,6 +612,7 @@
'DiffusionBlameConduitAPIMethod' => 'applications/diffusion/conduit/DiffusionBlameConduitAPIMethod.php',
'DiffusionBlameQuery' => 'applications/diffusion/query/blame/DiffusionBlameQuery.php',
'DiffusionBlockHeraldAction' => 'applications/diffusion/herald/DiffusionBlockHeraldAction.php',
+ 'DiffusionBranchListView' => 'applications/diffusion/view/DiffusionBranchListView.php',
'DiffusionBranchQueryConduitAPIMethod' => 'applications/diffusion/conduit/DiffusionBranchQueryConduitAPIMethod.php',
'DiffusionBranchTableController' => 'applications/diffusion/controller/DiffusionBranchTableController.php',
'DiffusionBranchTableView' => 'applications/diffusion/view/DiffusionBranchTableView.php',
@@ -5580,6 +5581,7 @@
'DiffusionBlameConduitAPIMethod' => 'DiffusionQueryConduitAPIMethod',
'DiffusionBlameQuery' => 'DiffusionQuery',
'DiffusionBlockHeraldAction' => 'HeraldAction',
+ 'DiffusionBranchListView' => 'DiffusionView',
'DiffusionBranchQueryConduitAPIMethod' => 'DiffusionQueryConduitAPIMethod',
'DiffusionBranchTableController' => 'DiffusionController',
'DiffusionBranchTableView' => 'DiffusionView',
diff --git a/src/applications/audit/storage/PhabricatorAuditTransaction.php b/src/applications/audit/storage/PhabricatorAuditTransaction.php
--- a/src/applications/audit/storage/PhabricatorAuditTransaction.php
+++ b/src/applications/audit/storage/PhabricatorAuditTransaction.php
@@ -49,6 +49,17 @@
return $blocks;
}
+ public function getActionStrength() {
+ $type = $this->getTransactionType();
+
+ switch ($type) {
+ case self::TYPE_COMMIT:
+ return 3.0;
+ }
+
+ return parent::getActionStrength();
+ }
+
public function getRequiredHandlePHIDs() {
$phids = parent::getRequiredHandlePHIDs();
diff --git a/src/applications/diffusion/conduit/DiffusionSearchQueryConduitAPIMethod.php b/src/applications/diffusion/conduit/DiffusionSearchQueryConduitAPIMethod.php
--- a/src/applications/diffusion/conduit/DiffusionSearchQueryConduitAPIMethod.php
+++ b/src/applications/diffusion/conduit/DiffusionSearchQueryConduitAPIMethod.php
@@ -57,11 +57,14 @@
$results = array();
$future = $repository->getLocalCommandFuture(
// NOTE: --perl-regexp is available only with libpcre compiled in.
- 'grep --extended-regexp --null -n --no-color -e %s %s -- %s',
- $grep,
+ 'grep --extended-regexp --null -n --no-color -f - %s -- %s',
$drequest->getStableCommit(),
$path);
+ // NOTE: We're writing the pattern on stdin to avoid issues with UTF8
+ // being mangled by the shell. See T12807.
+ $future->write($grep);
+
$binary_pattern = '/Binary file [^:]*:(.+) matches/';
$lines = new LinesOfALargeExecFuture($future);
diff --git a/src/applications/diffusion/controller/DiffusionBranchTableController.php b/src/applications/diffusion/controller/DiffusionBranchTableController.php
--- a/src/applications/diffusion/controller/DiffusionBranchTableController.php
+++ b/src/applications/diffusion/controller/DiffusionBranchTableController.php
@@ -48,7 +48,7 @@
->withRepository($repository)
->execute();
- $table = id(new DiffusionBranchTableView())
+ $list = id(new DiffusionBranchListView())
->setUser($viewer)
->setBranches($branches)
->setCommits($commits)
@@ -57,7 +57,7 @@
$content = id(new PHUIObjectBoxView())
->setHeaderText($repository->getName())
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
- ->setTable($table)
+ ->setTable($list)
->setPager($pager);
}
@@ -84,10 +84,7 @@
$repository->getDisplayName(),
))
->setCrumbs($crumbs)
- ->appendChild(
- array(
- $view,
- ));
+ ->appendChild($view);
}
}
diff --git a/src/applications/diffusion/view/DiffusionBranchListView.php b/src/applications/diffusion/view/DiffusionBranchListView.php
new file mode 100644
--- /dev/null
+++ b/src/applications/diffusion/view/DiffusionBranchListView.php
@@ -0,0 +1,179 @@
+<?php
+
+final class DiffusionBranchListView extends DiffusionView {
+
+ private $branches;
+ private $commits = array();
+
+ public function setBranches(array $branches) {
+ assert_instances_of($branches, 'DiffusionRepositoryRef');
+ $this->branches = $branches;
+ return $this;
+ }
+
+ public function setCommits(array $commits) {
+ assert_instances_of($commits, 'PhabricatorRepositoryCommit');
+ $this->commits = mpull($commits, null, 'getCommitIdentifier');
+ return $this;
+ }
+
+ public function render() {
+ $drequest = $this->getDiffusionRequest();
+ $current_branch = $drequest->getBranch();
+ $repository = $drequest->getRepository();
+ $commits = $this->commits;
+ $viewer = $this->getUser();
+ require_celerity_resource('diffusion-history-css');
+
+ $buildables = $this->loadBuildables($commits);
+ $have_builds = false;
+
+ $can_close_branches = ($repository->isHg());
+
+ Javelin::initBehavior('phabricator-tooltips');
+
+ $doc_href = PhabricatorEnv::getDoclink('Diffusion User Guide: Autoclose');
+ $list = id(new PHUIObjectItemListView())
+ ->setFlush(true)
+ ->addClass('diffusion-history-list')
+ ->addClass('diffusion-branch-list');
+
+ foreach ($this->branches as $branch) {
+ $build_view = null;
+ $compare_button = null;
+ $commit = idx($commits, $branch->getCommitIdentifier());
+ if ($commit) {
+ $details = $commit->getSummary();
+ $history_href = $this->getDiffusionRequest()->generateURI(
+ array(
+ 'action' => 'history',
+ 'branch' => $branch->getShortName(),
+ ));
+ $datetime = phutil_tag(
+ 'a',
+ array(
+ 'href' => $history_href,
+ ),
+ $viewer->formatShortDateTime($commit->getEpoch()));
+ $buildable = idx($buildables, $commit->getPHID());
+ if ($buildable) {
+ $status = $buildable->getBuildableStatus();
+ $icon = HarbormasterBuildable::getBuildableStatusIcon($status);
+ $color = HarbormasterBuildable::getBuildableStatusColor($status);
+ $name = HarbormasterBuildable::getBuildableStatusName($status);
+ $build_view = id(new PHUIButtonView())
+ ->setTag('a')
+ ->setText($name)
+ ->setIcon($icon)
+ ->setColor($color)
+ ->setHref('/'.$buildable->getMonogram())
+ ->addClass('mmr')
+ ->setButtonType(PHUIButtonView::BUTTONTYPE_SIMPLE);
+ }
+ } else {
+ $datetime = null;
+ $details = null;
+ }
+
+ if ($repository->supportsBranchComparison()) {
+ $compare_uri = $drequest->generateURI(
+ array(
+ 'action' => 'compare',
+ 'head' => $branch->getShortName(),
+ 'against' => $current_branch,
+ ));
+ $can_compare = ($branch->getShortName() != $current_branch);
+ if ($can_compare) {
+ $compare_button = id(new PHUIButtonView())
+ ->setTag('a')
+ ->setText(pht('Compare'))
+ ->setButtonType(PHUIButtonView::BUTTONTYPE_SIMPLE)
+ ->setHref($compare_uri);
+ }
+ }
+
+ switch ($repository->shouldSkipAutocloseBranch($branch->getShortName())) {
+ case PhabricatorRepository::BECAUSE_REPOSITORY_IMPORTING:
+ $icon = 'fa-times bluegrey';
+ $tip = pht('Repository Importing');
+ break;
+ case PhabricatorRepository::BECAUSE_AUTOCLOSE_DISABLED:
+ $icon = 'fa-times bluegrey';
+ $tip = pht('Repository Autoclose Disabled');
+ break;
+ case PhabricatorRepository::BECAUSE_BRANCH_UNTRACKED:
+ $icon = 'fa-times bluegrey';
+ $tip = pht('Branch Untracked');
+ break;
+ case PhabricatorRepository::BECAUSE_BRANCH_NOT_AUTOCLOSE:
+ $icon = 'fa-times bluegrey';
+ $tip = pht('Branch Autoclose Disabled');
+ break;
+ case null:
+ $icon = 'fa-check bluegrey';
+ $tip = pht('Autoclose Enabled');
+ break;
+ default:
+ $icon = 'fa-question';
+ $tip = pht('Status Unknown');
+ break;
+ }
+ $icon = id(new PHUIIconView())->setIcon($icon);
+ $time = id(new PHUIIconView())->setIcon('fa-clock-o');
+
+ $fields = $branch->getRawFields();
+ $closed = idx($fields, 'closed');
+ if ($closed) {
+ $status = pht('Closed');
+ } else {
+ $status = pht('Open');
+ }
+
+ $have_builds = '';
+ $can_close_branches = '';
+
+ $commit_link = $repository->getCommitURI(
+ $branch->getCommitIdentifier());
+
+ $commit_name = $repository->formatCommitName(
+ $branch->getCommitIdentifier(), $local = true);
+
+ $commit_tag = id(new PHUITagView())
+ ->setName($commit_name)
+ ->setHref($commit_link)
+ ->setType(PHUITagView::TYPE_SHADE)
+ ->setColor(PHUITagView::COLOR_INDIGO)
+ ->setBorder(PHUITagView::BORDER_NONE)
+ ->setSlimShady(true);
+
+ $item = id(new PHUIObjectItemView())
+ ->setHeader($branch->getShortName())
+ ->setHref($drequest->generateURI(
+ array(
+ 'action' => 'browse',
+ 'branch' => $branch->getShortName(),
+ )))
+ ->setSubhead(array($commit_tag, ' ', $details))
+ ->addAttribute(array($time, ' ', $datetime))
+ ->addAttribute(array($icon, ' ', $tip))
+ ->setSideColumn(array(
+ $build_view,
+ $compare_button,
+ ));
+
+ if ($branch->getShortName() == $current_branch) {
+ $current_tag = id(new PHUITagView())
+ ->setName(pht('Current'))
+ ->setType(PHUITagView::TYPE_OUTLINE)
+ ->setColor(PHUITagView::COLOR_SKY)
+ ->setSlimShady(true);
+ $item->addAttribute($current_tag);
+ }
+
+ $list->addItem($item);
+
+ }
+ return $list;
+
+ }
+}
diff --git a/src/applications/metamta/PhabricatorMetaMTAWorker.php b/src/applications/metamta/PhabricatorMetaMTAWorker.php
--- a/src/applications/metamta/PhabricatorMetaMTAWorker.php
+++ b/src/applications/metamta/PhabricatorMetaMTAWorker.php
@@ -13,10 +13,6 @@
protected function doWork() {
$message = $this->loadMessage();
- if (!$message) {
- throw new PhabricatorWorkerPermanentFailureException(
- pht('Unable to load message!'));
- }
if ($message->getStatus() != PhabricatorMailOutboundStatus::STATUS_QUEUE) {
return;
@@ -32,7 +28,18 @@
private function loadMessage() {
$message_id = $this->getTaskData();
- return id(new PhabricatorMetaMTAMail())->load($message_id);
+ $message = id(new PhabricatorMetaMTAMail())
+ ->load($message_id);
+
+ if (!$message) {
+ throw new PhabricatorWorkerPermanentFailureException(
+ pht(
+ 'Unable to load mail message (with ID "%s") while preparing to '.
+ 'deliver it.',
+ $message_id));
+ }
+
+ return $message;
}
public function renderForDisplay(PhabricatorUser $viewer) {
diff --git a/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php b/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php
--- a/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php
+++ b/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php
@@ -23,11 +23,15 @@
$ex = $task->getExecutionException();
if ($ex) {
if ($ex instanceof PhabricatorWorkerPermanentFailureException) {
- $this->log(
+ // NOTE: Make sure these reach the daemon log, even when not
+ // running in "phd.verbose" mode. See T12803 for discussion.
+ $log_exception = new PhutilProxyException(
pht(
- 'Task %d was cancelled: %s',
- $id,
- $ex->getMessage()));
+ 'Task "%s" encountered a permanent failure and was '.
+ 'cancelled.',
+ $id),
+ $ex);
+ phlog($log_exception);
} else if ($ex instanceof PhabricatorWorkerYieldException) {
$this->log(pht('Task %s yielded.', $id));
} else {
diff --git a/webroot/rsrc/css/application/diffusion/diffusion-history.css b/webroot/rsrc/css/application/diffusion/diffusion-history.css
--- a/webroot/rsrc/css/application/diffusion/diffusion-history.css
+++ b/webroot/rsrc/css/application/diffusion/diffusion-history.css
@@ -30,6 +30,23 @@
margin-left: 4px;
}
+/* - Branch Styles ----------------------------------------------------------*/
+
+.diffusion-branch-list .phui-oi-attribute a {
+ color: {$darkbluetext};
+}
+
+.diffusion-branch-list .phui-oi-attribute-spacer {
+ visibility: hidden;
+}
+
+.diffusion-branch-list .phui-oi-subhead {
+ color: {$bluetext};
+}
+
+.diffusion-branch-list .phui-oi-subhead .phui-tag-view {
+ margin-right: 4px;
+}
/* - Phone Style ------------------------------------------------------------*/
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 1, 8:02 AM (5 d, 4 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7728752
Default Alt Text
D18113.id43573.diff (14 KB)
Attached To
Mode
D18113: Add DiffusionBranchListView for browsing branches
Attached
Detach File
Event Timeline
Log In to Comment