[PATCH 2 of 4 V2] resolve: move implementation into cmdutil

Martin von Zweigbergk martinvonz at google.com
Tue Mar 22 13:16:40 EDT 2016


On Sun, Mar 20, 2016 at 8:18 PM, Siddharth Agarwal <sid0 at fb.com> wrote:
> # HG changeset patch
> # User Siddharth Agarwal <sid0 at fb.com>
> # Date 1458530235 25200
> #      Sun Mar 20 20:17:15 2016 -0700
> # Node ID 65d7aff92105e37a40d845d7dd95267cfb920299
> # Parent  b190b4bd5de25c137286cbb21572e9e1160b415b
> resolve: move implementation into cmdutil
>
> This function's getting way too big, and having this will allow us to wrap more
> of resolve inside a ui.tempconfig context.
>
> For 'showhint' we return a tuple so that we can return multiple pieces of
> information. That'll come in handy in a subsequent patch.
>
> The passing in of 'flaglist' is temporary -- in a subsequent patch we'll stop
> passing it in.
>
> diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
> --- a/mercurial/cmdutil.py
> +++ b/mercurial/cmdutil.py
> @@ -2883,6 +2883,142 @@ def commitstatus(repo, node, branch, bhe
>  def postcommitstatus(repo, pats, opts):
>      return repo.status(match=scmutil.match(repo[None], pats, opts))
>
> +def resolve(ui, repo, ms, pats, opts, flaglist):
> +    from . import merge as mergemod

Why is it imported here? I've seen this kind of thing done in a few
other places, but can you remind me when it's needed/useful? Is it
some import cycle? If it is, then which direction is correct, for
cmdutil to depend on merge or for merge to depend on cmdutil?

I think I saw someone send patches for resolving a cycle involving
mergestate. Do you know if that's related?


More information about the Mercurial-devel mailing list