[PATCH 4 of 4 shelve-ext v3] shelve: make shelvestate use simplekeyvaluefile

Yuya Nishihara yuya at tcha.org
Fri Apr 14 07:15:44 EDT 2017


On Thu, 13 Apr 2017 21:28:52 +0000, Kostia Balytskyi wrote:
> > > Comparing versions (if I understand you correctly) wouldn't work, see
> > below.
> > 
> > I couldn't get why new format can't be version 2. The old format had '1\n'
> > for future extension. This patch introduces new format, so using '2\n' makes
> > sense to me.
> > 
> > The current simplekeyvaluefile API would make this a bit harder, but we can
> > extract functions to serialize and deserialize dict from/to file object.
> I do not understand what 'extract functions ...' means in this context? Can you explain?

We can move deserialization function (e.g. 'loadkv(fp: file) -> dict'
or 'loadkv(s: str) -> dict') from simplekeyvaluefile.read() for example.


More information about the Mercurial-devel mailing list