From f0a2b699ba626b38ad9b0becc5b8d5881b5c163c Mon Sep 17 00:00:00 2001 From: Christopher Speck Date: Fri, 11 Mar 2022 12:55:56 -0500 Subject: [PATCH] Update arc-hg to support mercurial 6.1 Summary: Updated the mercurial script to pull the `parseurl` function from the new module if pulling from the old module fails. Also updated pulling of `remoteopts` to follow the same pattern of fallback. Fixes T13672 Test Plan: Using mercurial 6.1 I ran `arc patch Dnnnnn --trace` and verified that it succeeded and in the trace output it used the `arc-ls-markers` extension. Using mercurial 4.7 I ran `arc patch Dnnnnn --trace` and verified that it succeeded and in the trace output it used the `arc-ls-markers` extension. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin Maniphest Tasks: T13672 Differential Revision: https://secure.phabricator.com/D21747 --- support/hg/arc-hg.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/support/hg/arc-hg.py b/support/hg/arc-hg.py index 6b34f80e..6689db86 100644 --- a/support/hg/arc-hg.py +++ b/support/hg/arc-hg.py @@ -39,12 +39,17 @@ except: command = cmdutil.command(cmdtable) try: - if "remoteopts" in cmdutil: - remoteopts = cmdutil.remoteopts + remoteopts = cmdutil.remoteopts except: from mercurial import commands remoteopts = commands.remoteopts +try: + parseurl = hg.parseurl +except: + from mercurial import utils + parseurl = utils.urlutil.parseurl + @command( b'arc-amend', [ @@ -268,7 +273,7 @@ def remotemarkers(ui, repo, source, opts): markers = [] - source, branches = hg.parseurl(ui.expandpath(source)) + source, branches = parseurl(ui.expandpath(source)) remote = hg.peer(repo, opts, source) with remote.commandexecutor() as e: