Page MenuHomePhabricator

D8381.id19917.diff
No OneTemporary

D8381.id19917.diff

diff --git a/src/workflow/ArcanistLandWorkflow.php b/src/workflow/ArcanistLandWorkflow.php
--- a/src/workflow/ArcanistLandWorkflow.php
+++ b/src/workflow/ArcanistLandWorkflow.php
@@ -701,19 +701,21 @@
// Collapse just the landing branch onto master.
// Leave its children on the original branch.
- $err = $repository_api->execPassthru(
- 'rebase --collapse --keep --logfile %s -r %s -d %s',
- $this->messageFile,
- $branch_range,
- $this->onto);
+ if ($branch_root !== $branch_rev_id) {
+ $err = $repository_api->execPassthru(
+ 'rebase --collapse --keep --logfile %s -r %s -d %s',
+ $this->messageFile,
+ $branch_range,
+ $this->onto);
- if ($err) {
- $repository_api->execManualLocal(
- 'rebase --abort');
- $this->restoreBranch();
- throw new ArcanistUsageException(
- "Squashing the commits under {$this->branch} failed. ".
- "Manually squash your commits and run 'arc land' again.");
+ if ($err) {
+ $repository_api->execManualLocal(
+ 'rebase --abort');
+ $this->restoreBranch();
+ throw new ArcanistUsageException(
+ "Squashing the commits under {$this->branch} failed. ".
+ "Manually squash your commits and run 'arc land' again.");
+ }
}
if ($repository_api->isBookmark($this->branch)) {
@@ -734,7 +736,7 @@
// check if the branch had children
list($output) = $repository_api->execxLocal(
"log -r %s --template %s",
- hgsprintf("children(%s)", $this->branch),
+ hgsprintf("children(%s) - children(%s)", $this->branch, $this->onto),
'{node}\n');
$child_branch_roots = phutil_split_lines($output, false);
@@ -985,9 +987,11 @@
$this->branch,
$common_ancestor));
- $repository_api->execxLocal(
- '--config extensions.mq= strip -r %s',
- $branch_root);
+ if ($branch_root !== '') {
+ $repository_api->execxLocal(
+ '--config extensions.mq= strip -r %s',
+ $branch_root);
+ }
if ($repository_api->isBookmark($this->branch)) {
$repository_api->execxLocal(

File Metadata

Mime Type
text/plain
Expires
Tue, Apr 8, 6:27 PM (2 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7608376
Default Alt Text
D8381.id19917.diff (2 KB)

Event Timeline