Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/applications/herald/adapter/HeraldDifferentialAdapter.php b/src/applications/herald/adapter/HeraldDifferentialAdapter.php
index 873f18a2dd..e1e7628e49 100644
--- a/src/applications/herald/adapter/HeraldDifferentialAdapter.php
+++ b/src/applications/herald/adapter/HeraldDifferentialAdapter.php
@@ -1,93 +1,93 @@
<?php
abstract class HeraldDifferentialAdapter extends HeraldAdapter {
private $repository = false;
private $diff;
abstract protected function loadChangesets();
abstract protected function loadChangesetsWithHunks();
public function getDiff() {
return $this->diff;
}
public function setDiff(DifferentialDiff $diff) {
$this->diff = $diff;
return $this;
}
public function loadRepository() {
if ($this->repository === false) {
$repository_phid = $this->getObject()->getRepositoryPHID();
if ($repository_phid) {
$repository = id(new PhabricatorRepositoryQuery())
->setViewer(PhabricatorUser::getOmnipotentUser())
->withPHIDs(array($repository_phid))
->needProjectPHIDs(true)
->executeOne();
}
- $this->repository = false;
+ $this->repository = $repository;
}
return $this->repository;
}
protected function loadAffectedPaths() {
$changesets = $this->loadChangesets();
$paths = array();
foreach ($changesets as $changeset) {
$paths[] = $this->getAbsoluteRepositoryPathForChangeset($changeset);
}
return $paths;
}
protected function getAbsoluteRepositoryPathForChangeset(
DifferentialChangeset $changeset) {
$repository = $this->loadRepository();
if (!$repository) {
return '/'.ltrim($changeset->getFilename(), '/');
}
$diff = $this->getDiff();
return $changeset->getAbsoluteRepositoryPath($repository, $diff);
}
protected function loadContentDictionary() {
$add_lines = DifferentialHunk::FLAG_LINES_ADDED;
$rem_lines = DifferentialHunk::FLAG_LINES_REMOVED;
$mask = ($add_lines | $rem_lines);
return $this->loadContentWithMask($mask);
}
protected function loadAddedContentDictionary() {
return $this->loadContentWithMask(DifferentialHunk::FLAG_LINES_ADDED);
}
protected function loadRemovedContentDictionary() {
return $this->loadContentWithMask(DifferentialHunk::FLAG_LINES_REMOVED);
}
protected function loadContentWithMask($mask) {
$changesets = $this->loadChangesetsWithHunks();
$dict = array();
foreach ($changesets as $changeset) {
$content = array();
foreach ($changeset->getHunks() as $hunk) {
$content[] = $hunk->getContentWithMask($mask);
}
$path = $this->getAbsoluteRepositoryPathForChangeset($changeset);
$dict[$path] = implode("\n", $content);
}
return $dict;
}
}

File Metadata

Mime Type
text/x-diff
Expires
Tue, Jun 10, 7:53 PM (1 d, 9 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
140893
Default Alt Text
(2 KB)

Event Timeline