comparison hgext/patchbomb.py @ 36668:e77cee5de1c7

py3: use b"%d" to covert integer to bytes instead of str Differential Revision: https://phab.mercurial-scm.org/D2618
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 02 Mar 2018 07:17:06 +0530
parents c6061cadb400
children 678d760c71ff
comparison
equal deleted inserted replaced
36667:bcfc4e3b6548 36668:e77cee5de1c7
210 flag = ' ' + flag 210 flag = ' ' + flag
211 211
212 if not numbered: 212 if not numbered:
213 return '[PATCH%s]' % flag 213 return '[PATCH%s]' % flag
214 else: 214 else:
215 tlen = len(str(total)) 215 tlen = len("%d" % total)
216 return '[PATCH %0*d of %d%s]' % (tlen, idx, total, flag) 216 return '[PATCH %0*d of %d%s]' % (tlen, idx, total, flag)
217 217
218 def makepatch(ui, repo, rev, patchlines, opts, _charsets, idx, total, numbered, 218 def makepatch(ui, repo, rev, patchlines, opts, _charsets, idx, total, numbered,
219 patchname=None): 219 patchname=None):
220 220
628 628
629 revs = scmutil.revrange(repo, revs) 629 revs = scmutil.revrange(repo, revs)
630 if outgoing: 630 if outgoing:
631 revs = _getoutgoing(repo, dest, revs) 631 revs = _getoutgoing(repo, dest, revs)
632 if bundle: 632 if bundle:
633 opts['revs'] = [str(r) for r in revs] 633 opts['revs'] = ["%d" % r for r in revs]
634 634
635 # check if revision exist on the public destination 635 # check if revision exist on the public destination
636 publicurl = repo.ui.config('patchbomb', 'publicurl') 636 publicurl = repo.ui.config('patchbomb', 'publicurl')
637 if publicurl: 637 if publicurl:
638 repo.ui.debug('checking that revision exist in the public repo\n') 638 repo.ui.debug('checking that revision exist in the public repo\n')