# HG changeset patch # User liscju # Date 2016-02-10 20:01:52 # Node ID 740208f6f6af21329568acd287563bc9d437b253 # Parent ff6e8dc659f860c9bdaf7d15cf7929009daa60a8 debugrevlog: fix dumping manifest fails on empty first revision (issue5062) diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -3216,12 +3216,16 @@ def debugrevlog(ui, repo, file_=None, ** ts = ts + rs heads -= set(r.parentrevs(rev)) heads.add(rev) + try: + compression = ts / r.end(rev) + except ZeroDivisionError: + compression = 0 ui.write("%5d %5d %5d %5d %5d %10d %4d %4d %4d %7d %9d " "%11d %5d %8d\n" % (rev, p1, p2, r.start(rev), r.end(rev), r.start(dbase), r.start(cbase), r.start(p1), r.start(p2), - rs, ts, ts / r.end(rev), len(heads), clen)) + rs, ts, compression, len(heads), clen)) return 0 v = r.version