[PATCH 1 of 2] resolve: move resolve in cmdutil

Augie Fackler raf at durin42.com
Thu Dec 3 08:24:20 CST 2015


On Wed, Dec 02, 2015 at 10:37:40PM -0800, Pierre-Yves David wrote:
>
>
> On 12/02/2015 04:41 PM, Laurent Charignon wrote:
> ># HG changeset patch
> ># User Laurent Charignon <lcharignon at fb.com>
> ># Date 1449103124 28800
> >#      Wed Dec 02 16:38:44 2015 -0800
> ># Node ID 8d5a092b64d9ddb7f6481bfe16aaeb6a7dab5951
> ># Parent  91905c0c47377520eebdedcfa6bcb73b77e24e0c
> >resolve: move resolve in cmdutil
> >
> >Having resolve in cmdutil makes it easier to call it outside the commands
> >module. This patch moves all the code from resolve from commands to cmdutil.
> >
> >diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
> >--- a/mercurial/cmdutil.py
> >+++ b/mercurial/cmdutil.py
> >@@ -2310,6 +2310,165 @@ def forget(ui, repo, match, prefix, expl
> >      forgot.extend(f for f in forget if f not in rejected)
> >      return bad, forgot
> >
> >+def resolve(ui, repo, *pats, **opts):
> >+    import merge as mergemod
>
> Urg, why are we importing this at this level? are you trying to avoid a
> cycle
>
> Is there other change to the moved code or is it just a plain move
> otherwise?

+1 - there's likely a fairly simple code rearrangement that would
properly define the layering relationship between cmdutil and
mergemod.

(I suspect the answer is "cmdutil is too big and needs to be split
up", but I haven't looked.)

>
> --
> Pierre-Yves David
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list