comparison hgext/obsolete.py @ 226:0892b91947ef

obsolete: export pretty printed json Will help unavoidable hand fixing.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Wed, 09 May 2012 12:43:45 +0200
parents f60555898df4
children 5a17c0d41a00
comparison
equal deleted inserted replaced
225:72af5aa43997 226:0892b91947ef
584 jmark = mark.copy() 584 jmark = mark.copy()
585 jmark['id'] = hex(jmark['id']) 585 jmark['id'] = hex(jmark['id'])
586 jmark['subjects'] = [hex(n) for n in jmark['subjects']] 586 jmark['subjects'] = [hex(n) for n in jmark['subjects']]
587 jmark['object'] = hex(jmark['object']) 587 jmark['object'] = hex(jmark['object'])
588 markers.append(jmark) 588 markers.append(jmark)
589 json.dump(markers, stream) 589 json.dump(markers, stream, indent=4)
590 590
591 def load(self, stream): 591 def load(self, stream):
592 for mark in json.load(stream): 592 for mark in json.load(stream):
593 mark['id'] = bin(mark['id']) 593 mark['id'] = bin(mark['id'])
594 mark['subjects'] = [bin(n) for n in mark['subjects']] 594 mark['subjects'] = [bin(n) for n in mark['subjects']]