Changeset View
Changeset View
Standalone View
Standalone View
src/repository/state/ArcanistMercurialLocalState.php
Show All 16 Lines | protected function executeSaveLocalState() { | ||||
list($branch) = $api->execxLocal('branch'); | list($branch) = $api->execxLocal('branch'); | ||||
$this->localBranch = trim($branch); | $this->localBranch = trim($branch); | ||||
$log->writeTrace( | $log->writeTrace( | ||||
pht('SAVE STATE'), | pht('SAVE STATE'), | ||||
pht( | pht( | ||||
'Saving local state (at "%s" on branch "%s").', | 'Saving local state (at "%s" on branch "%s").', | ||||
$this->getDisplayHash($this->localCommit), | $api->getDisplayHash($this->localCommit), | ||||
$this->localBranch)); | $this->localBranch)); | ||||
} | } | ||||
protected function executeRestoreLocalState() { | protected function executeRestoreLocalState() { | ||||
$api = $this->getRepositoryAPI(); | $api = $this->getRepositoryAPI(); | ||||
$log = $this->getWorkflow()->getLogEngine(); | $log = $this->getWorkflow()->getLogEngine(); | ||||
$log->writeStatus( | $log->writeStatus( | ||||
pht('LOAD STATE'), | pht('LOAD STATE'), | ||||
pht( | pht( | ||||
'Restoring local state (at "%s" on branch "%s").', | 'Restoring local state (at "%s" on branch "%s").', | ||||
$this->getDisplayHash($this->localCommit), | $api->getDisplayHash($this->localCommit), | ||||
$this->localBranch)); | $this->localBranch)); | ||||
$api->execxLocal('update -- %s', $this->localCommit); | $api->execxLocal('update -- %s', $this->localCommit); | ||||
$api->execxLocal('branch --force -- %s', $this->localBranch); | $api->execxLocal('branch --force -- %s', $this->localBranch); | ||||
} | } | ||||
protected function executeDiscardLocalState() { | protected function executeDiscardLocalState() { | ||||
return; | return; | ||||
} | } | ||||
protected function canStashChanges() { | protected function canStashChanges() { | ||||
$api = $this->getRepositoryAPI(); | $api = $this->getRepositoryAPI(); | ||||
return $api->getMercurialFeature('shelve'); | return $api->getMercurialFeature('shelve'); | ||||
} | } | ||||
protected function getIgnoreHints() { | protected function getIgnoreHints() { | ||||
return array( | return array( | ||||
pht( | pht( | ||||
'To configure Mercurial to ignore certain files in the working '. | 'To configure Mercurial to ignore certain files in the working '. | ||||
'copy, add them to ".hgignore".'), | 'copy, add them to ".hgignore".'), | ||||
); | ); | ||||
} | } | ||||
protected function newRestoreCommandsForDisplay() { | protected function newRestoreCommandsForDisplay() { | ||||
$api = $this->getRepositoryAPI(); | |||||
$commands = array(); | $commands = array(); | ||||
$commands[] = csprintf( | $commands[] = csprintf( | ||||
'hg update -- %s', | 'hg update -- %s', | ||||
$this->getDisplayHash($this->localCommit)); | $api->getDisplayHash($this->localCommit)); | ||||
$commands[] = csprintf( | $commands[] = csprintf( | ||||
'hg branch --force -- %s', | 'hg branch --force -- %s', | ||||
$this->localBranch); | $this->localBranch); | ||||
return $commands; | return $commands; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines |