1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 06:42:41 +01:00

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
This commit is contained in:
Christopher Speck 2022-03-11 12:55:56 -05:00
parent b50a646a3f
commit f0a2b699ba

View file

@ -39,12 +39,17 @@ except:
command = cmdutil.command(cmdtable) command = cmdutil.command(cmdtable)
try: try:
if "remoteopts" in cmdutil: remoteopts = cmdutil.remoteopts
remoteopts = cmdutil.remoteopts
except: except:
from mercurial import commands from mercurial import commands
remoteopts = commands.remoteopts remoteopts = commands.remoteopts
try:
parseurl = hg.parseurl
except:
from mercurial import utils
parseurl = utils.urlutil.parseurl
@command( @command(
b'arc-amend', b'arc-amend',
[ [
@ -268,7 +273,7 @@ def remotemarkers(ui, repo, source, opts):
markers = [] markers = []
source, branches = hg.parseurl(ui.expandpath(source)) source, branches = parseurl(ui.expandpath(source))
remote = hg.peer(repo, opts, source) remote = hg.peer(repo, opts, source)
with remote.commandexecutor() as e: with remote.commandexecutor() as e: