From patchwork Tue Aug 19 00:49:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [4,of,7] obsstore: drop 'date' from the metadata dictionnary From: Pierre-Yves David X-Patchwork-Id: 5497 Message-Id: <793dd98326b070cb4380.1408409374@marginatus.alto.octopoid.net> To: mercurial-devel@selenic.com Cc: Pierre-Yves David Date: Mon, 18 Aug 2014 17:49:34 -0700 # HG changeset patch # User Pierre-Yves David # Date 1408406768 25200 # Mon Aug 18 17:06:08 2014 -0700 # Node ID 793dd98326b070cb43804c3141e6053dc37c386e # Parent d0afac677e6327e4aff0e3d8bb48abb910824d2c obsstore: drop 'date' from the metadata dictionnary We are extracting the `date` information from the metadata at read time. However we failed to remove it from the metadata returned in the markers. This is now fixed. diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py --- a/mercurial/obsolete.py +++ b/mercurial/obsolete.py @@ -166,11 +166,13 @@ def _readmarkers(data): if len(metadata) != mdsize: raise util.Abort(_('parsing obsolete marker: metadata is too ' 'short, %d bytes expected, got %d') % (mdsize, len(metadata))) off += mdsize - date = util.parsedate(decodemeta(metadata).pop('date', '0 0')) + meta = decodemeta(metadata) + date = util.parsedate(meta.pop('date', '0 0')) + metadata = encodemeta(meta) yield (pre, sucs, flags, metadata, date, None) def encodemeta(meta): """Return encoded metadata string to string mapping.