[PATCH 5 of 8] obsstore: drop 'date' from the metadata dictionnary

Pierre-Yves David pierre-yves.david at ens-lyon.org
Tue Aug 19 17:46:43 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 05f415a6f7f41f8cd7b242209e823903828fa2e1
# Parent  6506a10c1fab25e50b7adfdc67157054896df596
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,14 +166,16 @@ 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
+        meta = decodemeta(metadata)
         try:
             date = util.parsedate(decodemeta(metadata).pop('date', '0 0'))
         except util.Abort:
             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