Changeset View
Changeset View
Standalone View
Standalone View
src/repository/marker/ArcanistMarkerRef.php
<?php | <?php | ||||
final class ArcanistMarkerRef | final class ArcanistMarkerRef | ||||
extends ArcanistRef { | extends ArcanistRef | ||||
implements | |||||
ArcanistDisplayRefInterface { | |||||
const HARDPOINT_COMMITREF = 'commitRef'; | const HARDPOINT_COMMITREF = 'arc.marker.commitRef'; | ||||
const HARDPOINT_WORKINGCOPYSTATEREF = 'arc.marker.workingCopyStateRef'; | |||||
const TYPE_BRANCH = 'branch'; | const TYPE_BRANCH = 'branch'; | ||||
const TYPE_BOOKMARK = 'bookmark'; | const TYPE_BOOKMARK = 'bookmark'; | ||||
private $name; | private $name; | ||||
private $markerType; | private $markerType; | ||||
private $epoch; | private $epoch; | ||||
private $markerHash; | private $markerHash; | ||||
private $commitHash; | private $commitHash; | ||||
private $displayHash; | |||||
private $treeHash; | private $treeHash; | ||||
private $summary; | private $summary; | ||||
private $message; | private $message; | ||||
private $isActive = false; | private $isActive = false; | ||||
public function getRefDisplayName() { | public function getRefDisplayName() { | ||||
return pht('Marker %s', $this->getName()); | return $this->getDisplayRefObjectName(); | ||||
} | |||||
public function getDisplayRefObjectName() { | |||||
switch ($this->getMarkerType()) { | |||||
case self::TYPE_BRANCH: | |||||
return pht('Branch "%s"', $this->getName()); | |||||
case self::TYPE_BOOKMARK: | |||||
return pht('Bookmark "%s"', $this->getName()); | |||||
default: | |||||
return pht('Marker "%s"', $this->getName()); | |||||
} | |||||
} | |||||
public function getDisplayRefTitle() { | |||||
return pht( | |||||
'%s %s', | |||||
$this->getDisplayHash(), | |||||
$this->getSummary()); | |||||
} | } | ||||
protected function newHardpoints() { | protected function newHardpoints() { | ||||
return array( | return array( | ||||
$this->newHardpoint(self::HARDPOINT_COMMITREF), | $this->newHardpoint(self::HARDPOINT_COMMITREF), | ||||
$this->newHardpoint(self::HARDPOINT_WORKINGCOPYSTATEREF), | |||||
); | ); | ||||
} | } | ||||
public function setName($name) { | public function setName($name) { | ||||
$this->name = $name; | $this->name = $name; | ||||
return $this; | return $this; | ||||
} | } | ||||
Show All 23 Lines | public function setMarkerHash($marker_hash) { | ||||
$this->markerHash = $marker_hash; | $this->markerHash = $marker_hash; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getMarkerHash() { | public function getMarkerHash() { | ||||
return $this->markerHash; | return $this->markerHash; | ||||
} | } | ||||
public function setDisplayHash($display_hash) { | |||||
$this->displayHash = $display_hash; | |||||
return $this; | |||||
} | |||||
public function getDisplayHash() { | |||||
return $this->displayHash; | |||||
} | |||||
public function setCommitHash($commit_hash) { | public function setCommitHash($commit_hash) { | ||||
$this->commitHash = $commit_hash; | $this->commitHash = $commit_hash; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getCommitHash() { | public function getCommitHash() { | ||||
return $this->commitHash; | return $this->commitHash; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | final class ArcanistMarkerRef | ||||
public function attachCommitRef(ArcanistCommitRef $ref) { | public function attachCommitRef(ArcanistCommitRef $ref) { | ||||
return $this->attachHardpoint(self::HARDPOINT_COMMITREF, $ref); | return $this->attachHardpoint(self::HARDPOINT_COMMITREF, $ref); | ||||
} | } | ||||
public function getCommitRef() { | public function getCommitRef() { | ||||
return $this->getHardpoint(self::HARDPOINT_COMMITREF); | return $this->getHardpoint(self::HARDPOINT_COMMITREF); | ||||
} | } | ||||
public function attachWorkingCopyStateRef(ArcanistWorkingCopyStateRef $ref) { | |||||
return $this->attachHardpoint(self::HARDPOINT_WORKINGCOPYSTATEREF, $ref); | |||||
} | |||||
public function getWorkingCopyStateRef() { | |||||
return $this->getHardpoint(self::HARDPOINT_WORKINGCOPYSTATEREF); | |||||
} | |||||
} | } |