[PATCH STABLE v2] debugrevlog: improve handling of empty manifests/changelogs

timeless timeless at gmail.com
Mon Feb 1 07:32:18 UTC 2016


This would be 9 of 9, but pushgate has an 8 element limit...
# HG changeset patch
# User timeless <timeless at mozdev.org>
# Date 1453754438 0
#      Mon Jan 25 20:40:38 2016 +0000
# Branch stable
# Node ID 18619d60dec78e05ac070556cd9903d12e44fb7b
# Parent  8e74d29278f9379ddb01794d43dca2f515fde93e
debugrevlog: fix crash with empty ts (issue5062)

diff -r 8e74d29278f9 -r 18619d60dec7 mercurial/commands.py
--- a/mercurial/commands.py     Sun Jan 31 20:57:45 2016 +0000
+++ b/mercurial/commands.py     Mon Jan 25 20:40:38 2016 +0000
@@ -3210,7 +3210,7 @@
                      (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, ts and ts / r.end(rev), len(heads), clen))
         return 0

     v = r.version
diff -r 8e74d29278f9 -r 18619d60dec7 tests/test-debugcommands.t
--- a/tests/test-debugcommands.t        Sun Jan 31 20:57:45 2016 +0000
+++ b/tests/test-debugcommands.t        Mon Jan 25 20:40:38 2016 +0000
@@ -98,6 +98,10 @@
   uncompressed data size (min/max/avg) : 0 / 43 / 21
   full revision size (min/max/avg)     : 0 / 44 / 22
   delta size (min/max/avg)             : 0 / 0 / 0
+  $ hg debugrevlog -m -d
+  # rev p1rev p2rev start   end deltastart base   p1   p2 rawsize
totalsize compression heads chainlen
+      0    -1    -1     0     0          0    0    0    0       0
    0           0     1        0
+      1    -1    -1     0    44          0    0    0    0      43
   43           0     2        0

 Test debugindex, with and without the --debug flag
   $ hg debugindex a


More information about the Mercurial-devel mailing list