[PATCH 1 of 5 STABLE] filecache: pass func name that constructs the full path of the given file

Matt Mackall mpm at selenic.com
Wed Feb 29 00:20:03 UTC 2012


On Wed, 2012-02-29 at 01:40 +0200, Idan Kamara wrote:
> On Wed, Feb 29, 2012 at 12:59 AM, Matt Mackall <mpm at selenic.com> wrote:

> > Making this work cleanly is a simple matter of localizing the
> > path-joining logic to a single method that the derived class overrides:
> >
> > class storecache(scmutil.filecache):
> >    def join(self, obj, fname):
> >        return obj.sjoin(fname)
> 
> 
> I guess that's better, except it forces all clients of such classes
> to name their join function the same.

No, because this entire class is now specifically tailored for caching
store files for localrepo methods (note the 'sjoin'). The class is
tailored to the client, the client just needs to use the appropriate
class.

-- 
Mathematics is the supreme nostalgia of our time.





More information about the Mercurial-devel mailing list