[PATCH 3 of 7 V2] cmdutil: convert _revertprefetch() to a generic stored file hook (API)
Yuya Nishihara
yuya at tcha.org
Tue Feb 6 14:13:18 UTC 2018
On Tue, 6 Feb 2018 08:02:30 -0500, Matt Harbison wrote:
> > On Feb 6, 2018, at 7:20 AM, Yuya Nishihara <yuya at tcha.org> wrote:
> > - prefetchfiles() could be hosted by mergemod so lfs won't need to wrap
> > applyupdates().
>
> Would it be better to keep it in cmdutil, and call it just before calling applyupdates()?
That wouldn't be possible because the actions are calculated in merge.py.
> Calling mergemod.prefetchfiles() from archive, for example, seems weird, doesn’t it? Or am I misunderstanding?
Another option would be repo.prefetchfiles(), but I'm not sure if it's a
good idea.
> > - it could be a list of callback functions, instead of carefully wrapping
> > the function itself
>
> Just a raw list that everything can access, or should it have add/remove methods too? I’ve seen both patterns with hook registration, IIRC.
I have no preference.
More information about the Mercurial-devel
mailing list