Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14726866
D9488.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
D9488.diff
View Options
diff --git a/src/workflow/ArcanistUpgradeWorkflow.php b/src/workflow/ArcanistUpgradeWorkflow.php
--- a/src/workflow/ArcanistUpgradeWorkflow.php
+++ b/src/workflow/ArcanistUpgradeWorkflow.php
@@ -27,7 +27,11 @@
}
public function getArguments() {
- return array();
+ return array(
+ 'force' => array(
+ 'help' => 'Forces an upgrade, discarding all local commits.',
+ )
+ );
}
public function run() {
@@ -66,11 +70,16 @@
}
chdir($root);
- try {
- phutil_passthru('git pull --rebase');
- } catch (Exception $ex) {
- phutil_passthru('git rebase --abort');
- throw $ex;
+ if ($this->getArgument('force')) {
+ phutil_passthru('git fetch origin master');
+ phutil_passthru('git reset --hard origin/master');
+ } else {
+ try {
+ phutil_passthru('git pull --rebase');
+ } catch (Exception $ex) {
+ phutil_passthru('git rebase --abort');
+ throw $ex;
+ }
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 19, 3:50 AM (20 h, 52 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7016812
Default Alt Text
D9488.diff (1 KB)
Attached To
Mode
D9488: added arc upgrade --force, which discards all local commits and syncs it up with origin.
Attached
Detach File
Event Timeline
Log In to Comment