Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/customfield/DifferentialBranchField.php
Show All 29 Lines | final class DifferentialBranchField | ||||
public function renderDiffPropertyViewLabel(DifferentialDiff $diff) { | public function renderDiffPropertyViewLabel(DifferentialDiff $diff) { | ||||
return $this->getFieldName(); | return $this->getFieldName(); | ||||
} | } | ||||
public function renderDiffPropertyViewValue(DifferentialDiff $diff) { | public function renderDiffPropertyViewValue(DifferentialDiff $diff) { | ||||
return $this->getBranchDescription($diff); | return $this->getBranchDescription($diff); | ||||
} | } | ||||
private function getBranchDescription(DifferentialDiff $diff) { | private function getBranchDescription(DifferentialDiff $diff) { | ||||
$branch = $diff->getBranch(); | $branch = coalesce($diff->getBranch(), ''); | ||||
$bookmark = $diff->getBookmark(); | $bookmark = coalesce($diff->getBookmark(), ''); | ||||
if (strlen($branch) && strlen($bookmark)) { | if (strlen($branch) && strlen($bookmark)) { | ||||
return pht('%s (bookmark) on %s (branch)', $bookmark, $branch); | return pht('%s (bookmark) on %s (branch)', $bookmark, $branch); | ||||
} else if (strlen($bookmark)) { | } else if (strlen($bookmark)) { | ||||
return pht('%s (bookmark)', $bookmark); | return pht('%s (bookmark)', $bookmark); | ||||
} else if (strlen($branch)) { | } else if (strlen($branch)) { | ||||
speck: Please see this simplified suggested change | |||||
$onto = $diff->loadTargetBranch(); | $onto = $diff->loadTargetBranch(); | ||||
if (strlen($onto) && ($onto !== $branch)) { | if (strlen($onto) && ($onto !== $branch)) { | ||||
return pht( | return pht( | ||||
'%s (branched from %s)', | '%s (branched from %s)', | ||||
$branch, | $branch, | ||||
$onto); | $onto); | ||||
} else { | } else { | ||||
return $branch; | return $branch; | ||||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0
Please see this simplified suggested change