Skip to content

Commit

Permalink
Update arc-hg to support mercurial 6.1
Browse files Browse the repository at this point in the history
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
  • Loading branch information
neandrake committed Mar 11, 2022
1 parent b50a646 commit f0a2b69
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions support/hg/arc-hg.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,17 @@ def arc_items(dict):
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',
[
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit f0a2b69

Please sign in to comment.