Changeset View
Changeset View
Standalone View
Standalone View
src/land/engine/ArcanistMercurialLandEngine.php
| Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | if ($branch !== null) { | ||||
| pht( | pht( | ||||
| 'Landing the active branch, "%s".', | 'Landing the active branch, "%s".', | ||||
| $branch)); | $branch)); | ||||
| return array($branch); | return array($branch); | ||||
| } | } | ||||
| $commit = $api->getCanonicalRevisionName('.'); | $commit = $api->getCanonicalRevisionName('.'); | ||||
| $commit = $this->getDisplayHash($commit); | $commit = $api->getDisplayHash($commit); | ||||
| $log->writeStatus( | $log->writeStatus( | ||||
| pht('SOURCE'), | pht('SOURCE'), | ||||
| pht( | pht( | ||||
| 'Landing the active commit, "%s".', | 'Landing the active commit, "%s".', | ||||
| $this->getDisplayHash($commit))); | $api->getDisplayHash($commit))); | ||||
| return array($commit); | return array($commit); | ||||
| } | } | ||||
| protected function resolveSymbols(array $symbols) { | protected function resolveSymbols(array $symbols) { | ||||
| assert_instances_of($symbols, 'ArcanistLandSymbol'); | assert_instances_of($symbols, 'ArcanistLandSymbol'); | ||||
| $api = $this->getRepositoryAPI(); | $api = $this->getRepositoryAPI(); | ||||
| ▲ Show 20 Lines • Show All 427 Lines • ▼ Show 20 Lines | if ($this->getIntoLocal()) { | ||||
| $into_commit = $api->getCanonicalRevisionName($local_ref); | $into_commit = $api->getCanonicalRevisionName($local_ref); | ||||
| $log->writeStatus( | $log->writeStatus( | ||||
| pht('INTO COMMIT'), | pht('INTO COMMIT'), | ||||
| pht( | pht( | ||||
| 'Preparing merge into local target "%s", at commit "%s".', | 'Preparing merge into local target "%s", at commit "%s".', | ||||
| $local_ref, | $local_ref, | ||||
| $this->getDisplayHash($into_commit))); | $api->getDisplayHash($into_commit))); | ||||
| return $into_commit; | return $into_commit; | ||||
| } | } | ||||
| $target = id(new ArcanistLandTarget()) | $target = id(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( | ||||
| 'Preparing merge into "%s" from remote "%s", at commit "%s".', | 'Preparing merge into "%s" from remote "%s", at commit "%s".', | ||||
| $target->getRef(), | $target->getRef(), | ||||
| $target->getRemote(), | $target->getRemote(), | ||||
| $this->getDisplayHash($commit))); | $api->getDisplayHash($commit))); | ||||
| return $commit; | return $commit; | ||||
| } | } | ||||
| // If we have no valid target and the user passed "--into" explicitly, | // If we have no valid target and the user passed "--into" explicitly, | ||||
| // treat this as an error. For example, "arc land --into Q --onto Q", | // treat this as an error. For example, "arc land --into Q --onto Q", | ||||
| // where "Q" does not exist, is an error. | // where "Q" does not exist, is an error. | ||||
| if ($this->getIntoArgument()) { | if ($this->getIntoArgument()) { | ||||
| throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
| ▲ Show 20 Lines • Show All 329 Lines • ▼ Show 20 Lines | if ($bookmarks) { | ||||
| if ($old_position === $new_position) { | if ($old_position === $new_position) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| $head_commands[] = array( | $head_commands[] = array( | ||||
| 'bookmark', | 'bookmark', | ||||
| '--force', | '--force', | ||||
| '--rev', | '--rev', | ||||
| hgsprintf('%s', $this->getDisplayHash($new_position)), | hgsprintf('%s', $api->getDisplayHash($new_position)), | ||||
| '--', | '--', | ||||
| $bookmark_name, | $bookmark_name, | ||||
| ); | ); | ||||
| $api->execxLocal( | $api->execxLocal( | ||||
| 'bookmark --force --rev %s -- %s', | 'bookmark --force --rev %s -- %s', | ||||
| hgsprintf('%s', $new_position), | hgsprintf('%s', $new_position), | ||||
| $bookmark_name); | $bookmark_name); | ||||
| Show All 31 Lines | foreach ($restore as $bookmark_name => $old_position) { | ||||
| $tail = array(); | $tail = array(); | ||||
| $tail[] = 'bookmark'; | $tail[] = 'bookmark'; | ||||
| if ($old_position === null) { | if ($old_position === null) { | ||||
| $tail[] = '--delete'; | $tail[] = '--delete'; | ||||
| } else { | } else { | ||||
| $tail[] = '--force'; | $tail[] = '--force'; | ||||
| $tail[] = '--rev'; | $tail[] = '--rev'; | ||||
| $tail[] = hgsprintf('%s', $this->getDisplayHash($old_position)); | $tail[] = hgsprintf('%s', $api->getDisplayHash($old_position)); | ||||
| } | } | ||||
| $tail[] = '--'; | $tail[] = '--'; | ||||
| $tail[] = $bookmark_name; | $tail[] = $bookmark_name; | ||||
| $tail_commands[] = $tail; | $tail_commands[] = $tail; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 150 Lines • Show Last 20 Lines | |||||