[PATCH 2 of 6 V2] obscache: add an abstract base class for changelog+obstore cache

Augie Fackler raf at durin42.com
Mon May 22 18:08:37 EDT 2017


On Sat, May 20, 2017 at 05:30:16PM +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 41f64bdc68e3361782f19172c95db4775c44fa6c
> # Parent  221be1ef98902fa695a709371f75e63f9b3e950a
> # 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 41f64bdc68e3
> obscache: add an abstract base class for changelog+obstore 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
> @@ -69,6 +69,7 @@ comment associated with each format for
>  """
>  from __future__ import absolute_import
>
> +import abc
>  import errno
>  import hashlib
>  import struct
> @@ -1141,6 +1142,234 @@ def successorssets(repo, initialnode, ca
>                  cache[current] = final
>      return cache[initialnode]
>
> +class dualsourcecache(object):
> +    """An abstract class for cache that needs both changelog and obsstore


While I'm glad you liked my abc idea, doing the abc work does not
change my requirement that we split up the obsolete.py module before
adding a big pile of additional code - please figure out a way to get
dualsourceache et al in obscache.py or similar.

Thanks!


More information about the Mercurial-devel mailing list