Mercurial > hg
comparison hgext/remotefilelog/debugcommands.py @ 41259:194e43c2bac9
remotefilelog: fix some bytes/str portability issues for Python 3
A few remotefilelog tests still fail on Python 3, but it's a much better story
now.
Differential Revision: https://phab.mercurial-scm.org/D5609
author | Augie Fackler <augie@google.com> |
---|---|
date | Wed, 16 Jan 2019 11:03:04 -0500 |
parents | feae4d1f5e01 |
children | 876494fd967d |
comparison
equal
deleted
inserted
replaced
41258:a6b98c95bcf0 | 41259:194e43c2bac9 |
---|---|
240 (100.0 * abs(difference) / totalblobsize), | 240 (100.0 * abs(difference) / totalblobsize), |
241 ("smaller" if difference > 0 else "bigger")) | 241 ("smaller" if difference > 0 else "bigger")) |
242 | 242 |
243 ui.write(("Total:%s%s %s (%s)\n") % ( | 243 ui.write(("Total:%s%s %s (%s)\n") % ( |
244 "".ljust(2 * hashlen - len("Total:")), | 244 "".ljust(2 * hashlen - len("Total:")), |
245 str(totaldeltasize).ljust(12), | 245 ('%d' % totaldeltasize).ljust(12), |
246 str(totalblobsize).ljust(9), | 246 ('%d' % totalblobsize).ljust(9), |
247 deltastr | 247 deltastr |
248 )) | 248 )) |
249 | 249 |
250 bases = {} | 250 bases = {} |
251 nodes = set() | 251 nodes = set() |
275 blobsize = meta[constants.METAKEYSIZE] | 275 blobsize = meta[constants.METAKEYSIZE] |
276 totaldeltasize += deltalen | 276 totaldeltasize += deltalen |
277 totalblobsize += blobsize | 277 totalblobsize += blobsize |
278 else: | 278 else: |
279 blobsize = "(missing)" | 279 blobsize = "(missing)" |
280 ui.write("%s %s %s%s\n" % ( | 280 ui.write("%s %s %s%d\n" % ( |
281 hashformatter(node), | 281 hashformatter(node), |
282 hashformatter(deltabase), | 282 hashformatter(deltabase), |
283 str(deltalen).ljust(14), | 283 ('%d' % deltalen).ljust(14), |
284 blobsize)) | 284 blobsize)) |
285 | 285 |
286 if filename is not None: | 286 if filename is not None: |
287 printtotals() | 287 printtotals() |
288 | 288 |
340 "Delta Base".ljust(hashlen), | 340 "Delta Base".ljust(hashlen), |
341 "Delta SHA1".ljust(hashlen), | 341 "Delta SHA1".ljust(hashlen), |
342 "Delta Length".ljust(6), | 342 "Delta Length".ljust(6), |
343 )) | 343 )) |
344 | 344 |
345 ui.write("%s %s %s %s\n" % ( | 345 ui.write("%s %s %s %d\n" % ( |
346 hashformatter(node), | 346 hashformatter(node), |
347 hashformatter(deltabasenode), | 347 hashformatter(deltabasenode), |
348 nodemod.hex(hashlib.sha1(delta).digest()), | 348 nodemod.hex(hashlib.sha1(delta).digest()), |
349 len(delta))) | 349 len(delta))) |
350 | 350 |