comparison mercurial/obsolete.py @ 22257:4bc96685a40c

obsstore: drop 'date' from the metadata dictionary 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.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 18 Aug 2014 17:06:08 -0700
parents 3ae6cc6173e3
children cf414981978a
comparison
equal deleted inserted replaced
22256:3ae6cc6173e3 22257:4bc96685a40c
166 if len(metadata) != mdsize: 166 if len(metadata) != mdsize:
167 raise util.Abort(_('parsing obsolete marker: metadata is too ' 167 raise util.Abort(_('parsing obsolete marker: metadata is too '
168 'short, %d bytes expected, got %d') 168 'short, %d bytes expected, got %d')
169 % (mdsize, len(metadata))) 169 % (mdsize, len(metadata)))
170 off += mdsize 170 off += mdsize
171 meta = decodemeta(metadata)
171 try: 172 try:
172 date = util.parsedate(decodemeta(metadata).pop('date', '0 0')) 173 date = util.parsedate(decodemeta(metadata).pop('date', '0 0'))
173 except util.Abort: 174 except util.Abort:
174 date = (0., 0) 175 date = (0., 0)
176 metadata = encodemeta(meta)
175 177
176 yield (pre, sucs, flags, metadata, date, None) 178 yield (pre, sucs, flags, metadata, date, None)
177 179
178 def encodemeta(meta): 180 def encodemeta(meta):
179 """Return encoded metadata string to string mapping. 181 """Return encoded metadata string to string mapping.