comparison mercurial/commands.py @ 33089:9e0d222f5687

identify: change p1/p2 to a list of parents It makes sense because the nested data structure is a list of items.
author Yuya Nishihara <yuya@tcha.org>
date Mon, 26 Jun 2017 09:18:55 +0900
parents a49ab7f5e7e7
children 73dfc72704b6
comparison
equal deleted inserted replaced
33088:65cadeea6c22 33089:9e0d222f5687
2788 2788
2789 if num: 2789 if num:
2790 numoutput = ["%d" % p.rev() for p in parents] 2790 numoutput = ["%d" % p.rev() for p in parents]
2791 output.append("%s%s" % ('+'.join(numoutput), dirty)) 2791 output.append("%s%s" % ('+'.join(numoutput), dirty))
2792 2792
2793 for i, p in enumerate(parents): 2793 fn = fm.nested('parents')
2794 fn = fm.nested('p%d' % (i + 1)) 2794 for p in parents:
2795 fn.startitem() 2795 fn.startitem()
2796 fn.data(rev=p.rev()) 2796 fn.data(rev=p.rev())
2797 fn.data(node=p.hex()) 2797 fn.data(node=p.hex())
2798 fn.end() 2798 fn.end()
2799 else: 2799 else:
2800 hexoutput = hexfunc(ctx.node()) 2800 hexoutput = hexfunc(ctx.node())
2801 if default or id: 2801 if default or id:
2802 output = [hexoutput] 2802 output = [hexoutput]
2803 fm.data(id=hexoutput) 2803 fm.data(id=hexoutput)