Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 33015:f66be4caeaab
py3: use "%d" % val for int rather than pycompat.bytestr
Earlier I used pycompat.bytestr() to convert integers to bytes, but we can do
b"%d" % val to convert that int to bytes. b'' is already added by the
transformer.
Thanks to Yuya for suggesting this.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Thu, 22 Jun 2017 01:29:07 +0530 |
parents | f5f4c72de71a |
children | 3e102a8dd52c |
comparison
equal
deleted
inserted
replaced
33014:80a5d237a4ae | 33015:f66be4caeaab |
---|---|
2772 if default or id: | 2772 if default or id: |
2773 output = ["%s%s" % | 2773 output = ["%s%s" % |
2774 ('+'.join([hexfunc(p.node()) for p in parents]), changed)] | 2774 ('+'.join([hexfunc(p.node()) for p in parents]), changed)] |
2775 if num: | 2775 if num: |
2776 output.append("%s%s" % | 2776 output.append("%s%s" % |
2777 ('+'.join([pycompat.bytestr(p.rev()) for p in parents]), | 2777 ('+'.join(["%d" % p.rev() for p in parents]), changed)) |
2778 changed)) | |
2779 else: | 2778 else: |
2780 if default or id: | 2779 if default or id: |
2781 output = [hexfunc(ctx.node())] | 2780 output = [hexfunc(ctx.node())] |
2782 if num: | 2781 if num: |
2783 output.append(pycompat.bytestr(ctx.rev())) | 2782 output.append(pycompat.bytestr(ctx.rev())) |