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

login
register
mail settings
Submitter Pierre-Yves David
Date Aug. 19, 2014, 5:53 p.m.
Message ID <ce953e0e9dea9001b290.1408470820@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/5512/
State Superseded
Headers show

Comments

Pierre-Yves David - Aug. 19, 2014, 5:53 p.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 ce953e0e9dea9001b2907efa015823475aa43696
# Parent  ccb7430b59f3bd74b6192e3ca0858c509b94012e
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,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.