[PATCH 01 of 10 layering] dirstateguard: move to new module so I can break some layering violations

Augie Fackler raf at durin42.com
Wed Nov 23 11:15:10 EST 2016


> On Nov 22, 2016, at 09:09, Yuya Nishihara <yuya at tcha.org> wrote:
> 
> On Mon, 21 Nov 2016 22:05:16 -0500, Augie Fackler wrote:
>> # HG changeset patch
>> # User Augie Fackler <augie at google.com>
>> # Date 1479781772 18000
>> #      Mon Nov 21 21:29:32 2016 -0500
>> # Node ID 459f26a431fe7d04f7f935ccf46a3aec66956d84
>> # Parent  c84baff8c3d45579fc0cb03492ced5c8f745749c
>> dirstateguard: move to new module so I can break some layering violations
>> 
>> Recently in a review I noticed that localrepo almost has no reason to
>> import cmdutil anymore. Also, cmdutil is a little on the enormous
>> side, so breaking this class out strikes me as a win.
> 
> I'm not super excited about the new dirstateguard module, but the overall
> changes are great. So queued these, thanks.
> 
>> diff --git a/mercurial/cmdutil.py b/mercurial/dirstateguard.py
>> copy from mercurial/cmdutil.py
>> copy to mercurial/dirstateguard.py
>> --- a/mercurial/cmdutil.py
>> +++ b/mercurial/dirstateguard.py
> 
> Is copy-and-remove a preferred way for this kind of refactoring? I have
> an unsent patch that splits revset.py, so I want to know which is better.

I'd prefer it slightly, because it makes the blame history a little bit more intact in the long run.


More information about the Mercurial-devel mailing list