Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/storage/DifferentialChangeset.php
Show First 20 Lines • Show All 309 Lines • ▼ Show 20 Lines | public function attachDiff(DifferentialDiff $diff) { | ||||
$this->diff = $diff; | $this->diff = $diff; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getDiff() { | public function getDiff() { | ||||
return $this->assertAttached($this->diff); | return $this->assertAttached($this->diff); | ||||
} | } | ||||
public function getOldStatePathVector() { | |||||
$path = $this->getOldFile(); | |||||
if (!strlen($path)) { | |||||
$path = $this->getFilename(); | |||||
} | |||||
$path = trim($path, '/'); | |||||
$path = explode('/', $path); | |||||
return $path; | |||||
} | |||||
public function getNewStatePathVector() { | |||||
if (!$this->hasNewState()) { | |||||
return null; | |||||
} | |||||
$path = $this->getFilename(); | |||||
$path = trim($path, '/'); | |||||
$path = explode('/', $path); | |||||
return $path; | |||||
} | |||||
public function newFileTreeIcon() { | public function newFileTreeIcon() { | ||||
$icon = $this->getPathIconIcon(); | $icon = $this->getPathIconIcon(); | ||||
$color = $this->getPathIconColor(); | $color = $this->getPathIconColor(); | ||||
return id(new PHUIIconView()) | return id(new PHUIIconView()) | ||||
->setIcon("{$icon} {$color}"); | ->setIcon("{$icon} {$color}"); | ||||
} | } | ||||
public function getIsOwnedChangeset() { | public function getIsOwnedChangeset() { | ||||
$authority_packages = $this->getAuthorityPackages(); | $authority_packages = $this->getAuthorityPackages(); | ||||
$changeset_packages = $this->getChangesetPackages(); | $changeset_packages = $this->getChangesetPackages(); | ||||
if (!$authority_packages || !$changeset_packages) { | if (!$authority_packages || !$changeset_packages) { | ||||
return false; | return false; | ||||
} | } | ||||
return (bool)array_intersect_key($authority_packages, $changeset_packages); | return (bool)array_intersect_key($authority_packages, $changeset_packages); | ||||
} | } | ||||
public function getIsLowImportanceChangeset() { | public function getIsLowImportanceChangeset() { | ||||
$change_type = $this->getChangeType(); | if (!$this->hasNewState()) { | ||||
return true; | |||||
$change_map = array( | |||||
DifferentialChangeType::TYPE_DELETE => true, | |||||
DifferentialChangeType::TYPE_MOVE_AWAY => true, | |||||
DifferentialChangeType::TYPE_MULTICOPY => true, | |||||
); | |||||
if (isset($change_map[$change_type])) { | |||||
return $change_map[$change_type]; | |||||
} | } | ||||
if ($this->isGeneratedChangeset()) { | if ($this->isGeneratedChangeset()) { | ||||
return true; | return true; | ||||
} | } | ||||
return false; | return false; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 314 Lines • Show Last 20 Lines |