comparison mercurial/debugcommands.py @ 34327:12c42bcd4133

phases: move the binary decoding function in the phases module We move the decoding function near the encoding one in a place where they can be reused in other place (current target, 'exchange.py').
author Boris Feld <boris.feld@octobus.net>
date Tue, 19 Sep 2017 22:23:41 +0200
parents 311f6ccf8f23
children 75979c8d4572
comparison
equal deleted inserted replaced
34326:5779d096a696 34327:12c42bcd4133
308 fm.end() 308 fm.end()
309 309
310 def _debugphaseheads(ui, data, indent=0): 310 def _debugphaseheads(ui, data, indent=0):
311 """display version and markers contained in 'data'""" 311 """display version and markers contained in 'data'"""
312 indent_string = ' ' * indent 312 indent_string = ' ' * indent
313 headsbyphase = bundle2._readphaseheads(data) 313 headsbyphase = phases.binarydecode(data)
314 for phase in phases.allphases: 314 for phase in phases.allphases:
315 for head in headsbyphase[phase]: 315 for head in headsbyphase[phase]:
316 ui.write(indent_string) 316 ui.write(indent_string)
317 ui.write('%s %s\n' % (hex(head), phases.phasenames[phase])) 317 ui.write('%s %s\n' % (hex(head), phases.phasenames[phase]))
318 318