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

login
register
mail settings
Submitter timeless
Date Feb. 1, 2016, 7:32 a.m.
Message ID <CAAKMeYgsxXqcWKEUWq3=hETdkfR_FPvnYAwLCD3xSgukQQRm6A@mail.gmail.com>
Download mbox | patch
Permalink /patch/12922/
State Changes Requested
Headers show

Comments

timeless - Feb. 1, 2016, 7:32 a.m.
This would be 9 of 9, but pushgate has an 8 element limit...
# HG changeset patch
# User timeless <timeless@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)


 Test debugindex, with and without the --debug flag
   $ hg debugindex a
Pierre-Yves David - Feb. 1, 2016, 12:21 p.m.
On 02/01/2016 07:32 AM, timeless wrote:
> This would be 9 of 9, but pushgate has an 8 element limit...
> # HG changeset patch
> # User timeless <timeless@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)

What is "ts" ?

Patch

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