> On Feb 6, 2018, at 7:20 AM, Yuya Nishihara <y...@tcha.org> wrote: > >> On Tue, 06 Feb 2018 00:29:06 -0500, Matt Harbison wrote: >> # HG changeset patch >> # User Matt Harbison <matt_harbi...@yahoo.com> >> # Date 1517771668 18000 >> # Sun Feb 04 14:14:28 2018 -0500 >> # Node ID ab23d9644edaf62b2c3927b735d2170fc76ca711 >> # Parent 94d427f881cfca5cae792c5eac4bf00e942106ec >> cmdutil: convert _revertprefetch() to a generic stored file hook (API) >> >> + """Stub method for detecting extension wrapping of _revertprefetch(), to >> + issue a deprecation warning.""" >> + >> +_revertprefetch = _revertprefetchstub >> + >> +def _prefetchfiles(repo, ctx, files): >> + """Let extensions changing the storage layer prefetch content for any >> non >> + merge based command.""" > > Random ideas: > > - 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()? Calling mergemod.prefetchfiles() from archive, for example, seems weird, doesn’t it? Or am I misunderstanding? > - 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. > - should be a public function as archival.py depends on it for example? Good idea _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel