[PATCH 4 of 8] obscache: add an abstract base class for changelog+obstore cache

Augie Fackler raf at durin42.com
Fri May 19 18:33:51 EDT 2017


> On May 19, 2017, at 15:15, Pierre-Yves David <pierre-yves.david at ens-lyon.org> wrote:
> 
> 
> 
> On 05/19/2017 11:50 PM, Augie Fackler wrote:
>> On Fri, May 19, 2017 at 04:28:03PM +0200, Pierre-Yves David wrote:
>>> # HG changeset patch
>>> # User Pierre-Yves David <pierre-yves.david at octobus.net>
>>> # Date 1495194829 -7200
>>> #      Fri May 19 13:53:49 2017 +0200
>>> # Node ID b5c984cd0640255b94f22d56a4bfe398b2c5de2e
>>> # Parent  c67d3438f0d1ee56437ab0cffd49b02f441f876e
>>> # EXP-Topic obscache
>>> # Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
>>> #              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r b5c984cd0640
>>> obscache: add an abstract base class for changelog+obstore cache
>>> 
>>> There are many useful properties to cache around obsolescence. Some of them
>>> needs data from both the changelog and the obsstore. We needs logic handle to
>>> track changes and strip to both data structure are the same time. We also wants
>>> these to allow incremental update when possible instead of recomputing the whole
>>> set all the time.
>>> 
>>> As this is a common needs, we start by adding an abstract class reusable by
>>> multiple cache.
>>> 
>>> This code was initially part of the evolve extensions and matured there.
>>> 
>>> diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
>>> --- a/mercurial/obsolete.py
>>> +++ b/mercurial/obsolete.py
>>> @@ -1141,6 +1141,228 @@ def successorssets(repo, initialnode, ca
>>>                 cache[current] = final
>>>     return cache[initialnode]
>>> 
>>> +class dualsourcecache(object):
>> 
>> I'm not in love with this name, as it sounds more generic than it
>> is. I might also have some nits about it being an abstract class
>> depending on the future patches.
> 
> I'm not in love with that name too. It is the best reasonable thing that I could come with.
> 
> Alternative name proposal welcome.

It's explicitly only useful for caches that are based on both changelog and obsstore, right? Not any two sources? Why not changelogandobscachebase?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20170519/4a9f72fd/attachment.html>


More information about the Mercurial-devel mailing list