From b32149495b852d846127d002a7131fc67d4fbd47 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 18 Nov 2015 09:57:07 -0800 Subject: [PATCH] Don't give Mercurial empty string as a remote name Summary: Fixes T9807. We currently run commands like this in some cases: hg push -r master '' From T9807, it seems that older Mercurial treated `''` in the same way it would treat no argument, while newer Mercurial does not. Passing `''` is unusual and not intended. Test Plan: From T9807, @cspeckmim confirmed that running this command without the `''` works, and @jgelgens tested the patch itself. I didn't actually run this code myself, since I don't have Mercurial 3.6.1 installed and the fix seems straightfoward. Reviewers: chad Reviewed By: chad Subscribers: cspeckmim Maniphest Tasks: T9807 Differential Revision: https://secure.phabricator.com/D14531 --- src/workflow/ArcanistLandWorkflow.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/workflow/ArcanistLandWorkflow.php b/src/workflow/ArcanistLandWorkflow.php index 4525eeb4..23b0b7b4 100644 --- a/src/workflow/ArcanistLandWorkflow.php +++ b/src/workflow/ArcanistLandWorkflow.php @@ -1282,10 +1282,16 @@ EOTEXT $err = $repository_api->execPassthru('push %s', $this->remote); $cmd = 'hg push'; } else if ($this->isHg) { - $err = $repository_api->execPassthru( - 'push -r %s %s', - $this->onto, - $this->remote); + if (strlen($this->remote)) { + $err = $repository_api->execPassthru( + 'push -r %s %s', + $this->onto, + $this->remote); + } else { + $err = $repository_api->execPassthru( + 'push -r %s', + $this->onto); + } $cmd = 'hg push'; }