Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15434811
D14762.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D14762.diff
View Options
diff --git a/src/land/ArcanistGitLandEngine.php b/src/land/ArcanistGitLandEngine.php
--- a/src/land/ArcanistGitLandEngine.php
+++ b/src/land/ArcanistGitLandEngine.php
@@ -29,9 +29,7 @@
$this->updateWorkingCopy();
if ($this->getShouldHold()) {
- $this->writeInfo(
- pht('HOLD'),
- pht('Holding change locally, it has not been pushed.'));
+ $this->didHoldChanges();
} else {
$this->pushChange();
$this->reconcileLocalState();
@@ -542,4 +540,41 @@
);
}
+ 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.'));
+ }
+
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 26, 5:35 AM (5 d, 45 m ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7226110
Default Alt Text
D14762.diff (1 KB)
Attached To
Mode
D14762: Explain how to move forward or backward from `arc land --hold`
Attached
Detach File
Event Timeline
Log In to Comment