comparison mercurial/obsolete.py @ 22394:813c6855b97f

obsolete: properly drop 'date' from metadata Mistakes were made while resolving rebase conflicts in 4bc96685a40c. This led to 'date' being preserved in metadata when reading markers from a binary stream. As a result, some known markers were seen as "new" when pulling. I noticed it because a no-op pulls from main added about 600 duplicated markers to my obsstore (for each pull). I do not believe we need to perform any specific action to actively de-duplicates existing obsstore. After this fix, duplicated markers will no be propagated and the few affected repositories can probably deal with duplication (or people can repull the obsstore from a clone). As a side effect, we decode metadata only once, reducing the impact of the hack in fm0 to store extra important data (parents and date).
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 10 Sep 2014 14:42:52 +0100
parents cf7014c5f087
children 5c00c5298f98
comparison
equal deleted inserted replaced
22393:293930a1fa0a 22394:813c6855b97f
179 'short, %d bytes expected, got %d') 179 'short, %d bytes expected, got %d')
180 % (mdsize, len(metadata))) 180 % (mdsize, len(metadata)))
181 off += mdsize 181 off += mdsize
182 meta = decodemeta(metadata) 182 meta = decodemeta(metadata)
183 try: 183 try:
184 when, offset = decodemeta(metadata).pop('date', '0 0').split(' ') 184 when, offset = meta.pop('date', '0 0').split(' ')
185 date = float(when), int(offset) 185 date = float(when), int(offset)
186 except ValueError: 186 except ValueError:
187 date = (0., 0) 187 date = (0., 0)
188 parents = None 188 parents = None
189 if 'p2' in meta: 189 if 'p2' in meta: