[PATCH 4 of 7] obsstore: drop 'date' from the metadata dictionnary

Pierre-Yves David pierre-yves.david at ens-lyon.org
Mon Aug 18 19:49:34 CDT 2014


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# 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.


More information about the Mercurial-devel mailing list