Changeset View
Changeset View
Standalone View
Standalone View
src/land/engine/ArcanistMercurialLandEngine.php
Show First 20 Lines • Show All 288 Lines • ▼ Show 20 Lines | foreach ($onto_refs as $onto_ref) { | ||||
} | } | ||||
$match_count = count($matches); | $match_count = count($matches); | ||||
if ($match_count > 1) { | if ($match_count > 1) { | ||||
throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
pht( | pht( | ||||
'TODO: Ambiguous ref.')); | 'TODO: Ambiguous ref.')); | ||||
} else if (!$match_count) { | } else if (!$match_count) { | ||||
$new_bookmark = id(new ArcanistMarkerRef()) | $new_bookmark = (new ArcanistMarkerRef()) | ||||
->setMarkerType(ArcanistMarkerRef::TYPE_BOOKMARK) | ->setMarkerType(ArcanistMarkerRef::TYPE_BOOKMARK) | ||||
->setName($onto_ref) | ->setName($onto_ref) | ||||
->attachRemoteRef($remote_ref); | ->attachRemoteRef($remote_ref); | ||||
$onto_markers[] = $new_bookmark; | $onto_markers[] = $new_bookmark; | ||||
$new_markers[] = $new_bookmark; | $new_markers[] = $new_bookmark; | ||||
} else { | } else { | ||||
$onto_markers[] = head($matches); | $onto_markers[] = head($matches); | ||||
▲ Show 20 Lines • Show All 217 Lines • ▼ Show 20 Lines | if ($this->getIntoLocal()) { | ||||
pht( | pht( | ||||
'Preparing merge into local target "%s", at commit "%s".', | 'Preparing merge into local target "%s", at commit "%s".', | ||||
$local_ref, | $local_ref, | ||||
$api->getDisplayHash($into_commit))); | $api->getDisplayHash($into_commit))); | ||||
return $into_commit; | return $into_commit; | ||||
} | } | ||||
$target = id(new ArcanistLandTarget()) | $target = (new ArcanistLandTarget()) | ||||
->setRemote($this->getIntoRemote()) | ->setRemote($this->getIntoRemote()) | ||||
->setRef($this->getIntoRef()); | ->setRef($this->getIntoRef()); | ||||
$commit = $this->fetchTarget($target); | $commit = $this->fetchTarget($target); | ||||
if ($commit !== null) { | if ($commit !== null) { | ||||
$log->writeStatus( | $log->writeStatus( | ||||
pht('INTO COMMIT'), | pht('INTO COMMIT'), | ||||
pht( | pht( | ||||
Show All 32 Lines | final class ArcanistMercurialLandEngine | ||||
} | } | ||||
private function fetchTarget(ArcanistLandTarget $target) { | private function fetchTarget(ArcanistLandTarget $target) { | ||||
$api = $this->getRepositoryAPI(); | $api = $this->getRepositoryAPI(); | ||||
$log = $this->getLogEngine(); | $log = $this->getLogEngine(); | ||||
$target_name = $target->getRef(); | $target_name = $target->getRef(); | ||||
$remote_ref = id(new ArcanistRemoteRef()) | $remote_ref = (new ArcanistRemoteRef()) | ||||
->setRemoteName($target->getRemote()); | ->setRemoteName($target->getRemote()); | ||||
$markers = $api->newMarkerRefQuery() | $markers = $api->newMarkerRefQuery() | ||||
->withRemotes(array($remote_ref)) | ->withRemotes(array($remote_ref)) | ||||
->withNames(array($target_name)) | ->withNames(array($target_name)) | ||||
->execute(); | ->execute(); | ||||
$bookmarks = array(); | $bookmarks = array(); | ||||
▲ Show 20 Lines • Show All 156 Lines • ▼ Show 20 Lines | foreach ($symbols as $symbol) { | ||||
if (strlen($parents)) { | if (strlen($parents)) { | ||||
$parents = explode(' ', $parents); | $parents = explode(' ', $parents); | ||||
} else { | } else { | ||||
$parents = array(); | $parents = array(); | ||||
} | } | ||||
$summary = $parts[2]; | $summary = $parts[2]; | ||||
$commit_map[$hash] = id(new ArcanistLandCommit()) | $commit_map[$hash] = (new ArcanistLandCommit()) | ||||
->setHash($hash) | ->setHash($hash) | ||||
->setParents($parents) | ->setParents($parents) | ||||
->setSummary($summary); | ->setSummary($summary); | ||||
} | } | ||||
$commit = $commit_map[$hash]; | $commit = $commit_map[$hash]; | ||||
if ($is_first) { | if ($is_first) { | ||||
$commit->addDirectSymbol($symbol); | $commit->addDirectSymbol($symbol); | ||||
▲ Show 20 Lines • Show All 523 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