comparison hgext/evolve.py @ 1083:46048124c44b

evolve: drop a very old safe guard about bad marker The do not clean marker with nullrev successors. I assume none of them remains.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 27 Aug 2014 17:36:35 +0200
parents 74bc8a0c2c02
children 5459d9f48fea
comparison
equal deleted inserted replaced
1082:74bc8a0c2c02 1083:46048124c44b
344 # N.B. this is extremely similar to setupheaderopts() in mq.py 344 # N.B. this is extremely similar to setupheaderopts() in mq.py
345 if not opts.get('date') and opts.get('current_date'): 345 if not opts.get('date') and opts.get('current_date'):
346 opts['date'] = '%d %d' % util.makedate() 346 opts['date'] = '%d %d' % util.makedate()
347 if not opts.get('user') and opts.get('current_user'): 347 if not opts.get('user') and opts.get('current_user'):
348 opts['user'] = ui.username() 348 opts['user'] = ui.username()
349
350
351 #####################################################################
352 ### Critical fix ###
353 #####################################################################
354
355 @eh.wrapfunction(mercurial.obsolete, '_readmarkers')
356 def safereadmarkers(orig, data):
357 """safe maker wrapper to remove nullid succesors
358
359 Nullid successors was created by older version of evolve.
360 """
361 nb = 0
362 for marker in orig(data):
363 if nullid in marker[1]:
364 marker = (marker[0],
365 tuple(s for s in marker[1] if s != nullid),
366 marker[2],
367 marker[3])
368 nb += 1
369 yield marker
370 if nb:
371 e = sys.stderr
372 print >> e, 'repo contains %i invalid obsolescence markers' % nb
373 349
374 getrevs = obsolete.getrevs 350 getrevs = obsolete.getrevs
375 351
376 ##################################################################### 352 #####################################################################
377 ### Additional Utilities ### 353 ### Additional Utilities ###