comparison hgext/convert/cvsps.py @ 37658:34758397ad1b

py3: use b"%d" instead of str() to convert integers to bytes Differential Revision: https://phab.mercurial-scm.org/D3319
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 13 Apr 2018 16:30:27 +0530
parents 00e4bd97b095
children 72284d296b02
comparison
equal deleted inserted replaced
37657:23c4ddda7bbe 37658:34758397ad1b
917 ui.write(('Branchpoints: %s \n') % 917 ui.write(('Branchpoints: %s \n') %
918 ', '.join(sorted(cs.branchpoints))) 918 ', '.join(sorted(cs.branchpoints)))
919 if opts["parents"] and cs.parents: 919 if opts["parents"] and cs.parents:
920 if len(cs.parents) > 1: 920 if len(cs.parents) > 1:
921 ui.write(('Parents: %s\n' % 921 ui.write(('Parents: %s\n' %
922 (','.join([str(p.id) for p in cs.parents])))) 922 (','.join([(b"%d" % p.id) for p in cs.parents]))))
923 else: 923 else:
924 ui.write(('Parent: %d\n' % cs.parents[0].id)) 924 ui.write(('Parent: %d\n' % cs.parents[0].id))
925 925
926 if opts["ancestors"]: 926 if opts["ancestors"]:
927 b = cs.branch 927 b = cs.branch
939 fn = f.file 939 fn = f.file
940 if fn.startswith(opts["prefix"]): 940 if fn.startswith(opts["prefix"]):
941 fn = fn[len(opts["prefix"]):] 941 fn = fn[len(opts["prefix"]):]
942 ui.write('\t%s:%s->%s%s \n' % ( 942 ui.write('\t%s:%s->%s%s \n' % (
943 fn, '.'.join([str(x) for x in f.parent]) or 'INITIAL', 943 fn, '.'.join([str(x) for x in f.parent]) or 'INITIAL',
944 '.'.join([str(x) for x in f.revision]), 944 '.'.join([(b"%d" % x) for x in f.revision]),
945 ['', '(DEAD)'][f.dead])) 945 ['', '(DEAD)'][f.dead]))
946 ui.write('\n') 946 ui.write('\n')
947 947
948 # have we seen the start tag? 948 # have we seen the start tag?
949 if revisions and off: 949 if revisions and off:
950 if revisions[0] == str(cs.id) or \ 950 if revisions[0] == (b"%d" % cs.id) or \
951 revisions[0] in cs.tags: 951 revisions[0] in cs.tags:
952 off = False 952 off = False
953 953
954 # see if we reached the end tag 954 # see if we reached the end tag
955 if len(revisions) > 1 and not off: 955 if len(revisions) > 1 and not off:
956 if revisions[1] == str(cs.id) or \ 956 if revisions[1] == (b"%d" % cs.id) or \
957 revisions[1] in cs.tags: 957 revisions[1] in cs.tags:
958 break 958 break