Changeset View
Changeset View
Standalone View
Standalone View
src/land/ArcanistGitLandEngine.php
| Show All 23 Lines | public function execute() { | ||||
| $this->saveLocalState(); | $this->saveLocalState(); | ||||
| try { | try { | ||||
| $this->identifyRevision(); | $this->identifyRevision(); | ||||
| $this->updateWorkingCopy(); | $this->updateWorkingCopy(); | ||||
| if ($this->getShouldHold()) { | if ($this->getShouldHold()) { | ||||
| $this->writeInfo( | $this->didHoldChanges(); | ||||
| pht('HOLD'), | |||||
| pht('Holding change locally, it has not been pushed.')); | |||||
| } else { | } else { | ||||
| $this->pushChange(); | $this->pushChange(); | ||||
| $this->reconcileLocalState(); | $this->reconcileLocalState(); | ||||
| $api = $this->getRepositoryAPI(); | $api = $this->getRepositoryAPI(); | ||||
| $api->execxLocal('submodule update --init --recursive'); | $api->execxLocal('submodule update --init --recursive'); | ||||
| if ($this->getShouldKeep()) { | if ($this->getShouldKeep()) { | ||||
| ▲ Show 20 Lines • Show All 494 Lines • ▼ Show 20 Lines | private function getAuthorAndDate($commit) { | ||||
| list($date, $author, $email) = explode("\n", $info, 3); | list($date, $author, $email) = explode("\n", $info, 3); | ||||
| return array( | return array( | ||||
| "$author <{$email}>", | "$author <{$email}>", | ||||
| $date, | $date, | ||||
| ); | ); | ||||
| } | } | ||||
| private function didHoldChanges() { | |||||
| $this->writeInfo( | |||||
| pht('HOLD'), | |||||
| pht( | |||||
| 'Holding change locally, it has not been pushed.')); | |||||
| $push_command = csprintf( | |||||
| '$ git push -- %R %R:%R', | |||||
| $this->getTargetRemote(), | |||||
| $this->mergedRef, | |||||
| $this->getTargetOnto()); | |||||
| $restore_command = csprintf( | |||||
| '$ git checkout %R --', | |||||
| $this->localRef); | |||||
| echo tsprintf( | |||||
| "\n%s\n\n". | |||||
| "%s\n\n". | |||||
| " %s\n\n". | |||||
| "%s\n\n". | |||||
| " %s\n\n". | |||||
| "%s\n", | |||||
| pht( | |||||
| 'This local working copy now contains the merged changes in a '. | |||||
| 'detached state.'), | |||||
| pht('You can push the changes manually with this command:'), | |||||
| $push_command, | |||||
| pht( | |||||
| 'You can go back to how things were before you ran `arc land` with '. | |||||
| 'this command:'), | |||||
| $restore_command, | |||||
| pht( | |||||
| 'Local branches have not been changed, and are still in exactly the '. | |||||
| 'same state as before.')); | |||||
| } | |||||
| } | } | ||||