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

login
register
mail settings
Submitter Pierre-Yves David
Date Aug. 19, 2014, 12:49 a.m.
Message ID <793dd98326b070cb4380.1408409374@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/5497/
State Changes Requested
Headers show

Comments

Pierre-Yves David - Aug. 19, 2014, 12:49 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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.

Patch

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.