From: Jamie Wong Date: Fri, 8 Jun 2012 20:57:50 +0000 (-0400) Subject: Use .^ instead of HEAD^ for mercurial X-Git-Tag: conduit-6~262^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=bcbe1737b800603e44653072afa45064277c4fde;p=arcanist.git Use .^ instead of HEAD^ for mercurial Summary: ##arc amend## in a mercurial repo was failing with this message Usage Exception: Commit 'HEAD^' is not a valid Mercurial commit identifier. mercurial's .^ is about the same thing as git's HEAD^ Test Plan: ##arc amend## in a mercurial repo with ##"immutable_history" : "false"## in the ##.arcconfig##. Reviewers: epriestley Reviewed By: epriestley CC: vrana, aran, Korvin Differential Revision: https://secure.phabricator.com/D2690 --- diff --git a/src/workflow/ArcanistAmendWorkflow.php b/src/workflow/ArcanistAmendWorkflow.php index d4eb3972..6fa3938f 100644 --- a/src/workflow/ArcanistAmendWorkflow.php +++ b/src/workflow/ArcanistAmendWorkflow.php @@ -102,7 +102,11 @@ EOTEXT $revision_id = $this->normalizeRevisionID($this->getArgument('revision')); } - $repository_api->setRelativeCommit('HEAD^'); + if ($repository_api instanceof ArcanistGitAPI) { + $repository_api->setRelativeCommit('HEAD^'); + } else if ($repository_api instanceof ArcanistMercurialAPI) { + $repository_api->setRelativeCommit('.^'); + } $in_working_copy = $repository_api->loadWorkingCopyDifferentialRevisions( $this->getConduit(),