##// END OF EJS Templates
debugrevlog: cope with empty revlog files...
Augie Fackler -
r26826:39dbf495 stable
parent child Browse files
Show More
@@ -3037,7 +3037,9 b' def debugrevlog(ui, repo, file_=None, **'
3037 totalsize = fulltotal + deltatotal
3037 totalsize = fulltotal + deltatotal
3038 avgchainlen = sum(chainlengths) / numrevs
3038 avgchainlen = sum(chainlengths) / numrevs
3039 maxchainlen = max(chainlengths)
3039 maxchainlen = max(chainlengths)
3040 compratio = totalrawsize / totalsize
3040 compratio = 1
3041 if totalsize:
3042 compratio = totalrawsize / totalsize
3041
3043
3042 basedfmtstr = '%%%dd\n'
3044 basedfmtstr = '%%%dd\n'
3043 basepcfmtstr = '%%%dd %s(%%5.2f%%%%)\n'
3045 basepcfmtstr = '%%%dd %s(%%5.2f%%%%)\n'
@@ -3048,7 +3050,10 b' def debugrevlog(ui, repo, file_=None, **'
3048 return basepcfmtstr % (len(str(max)), ' ' * padding)
3050 return basepcfmtstr % (len(str(max)), ' ' * padding)
3049
3051
3050 def pcfmt(value, total):
3052 def pcfmt(value, total):
3051 return (value, 100 * float(value) / total)
3053 if total:
3054 return (value, 100 * float(value) / total)
3055 else:
3056 return value, 100.0
3052
3057
3053 ui.write(('format : %d\n') % format)
3058 ui.write(('format : %d\n') % format)
3054 ui.write(('flags : %s\n') % ', '.join(flags))
3059 ui.write(('flags : %s\n') % ', '.join(flags))
General Comments 0
You need to be logged in to leave comments. Login now