Patchwork [4,of,8,STABLE] debugrevlog: add bundle

login
register
mail settings
Submitter timeless@mozdev.org
Date Feb. 1, 2016, 7:29 a.m.
Message ID <cf775b5fa387784ad446.1454311755@waste.org>
Download mbox | patch
Permalink /patch/12917/
State Changes Requested
Headers show

Comments

timeless@mozdev.org - Feb. 1, 2016, 7:29 a.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1454287309 0
#      Mon Feb 01 00:41:49 2016 +0000
# Branch stable
# Node ID cf775b5fa387784ad4468a9bb1fb60a554a7977e
# Parent  656e33b198f29f222c54e6eb546f5ecea8928c64
debugrevlog: add bundle
Pierre-Yves David - Feb. 1, 2016, 12:19 p.m.
On 02/01/2016 07:29 AM, timeless wrote:
> # HG changeset patch
> # User timeless <timeless@mozdev.org>
> # Date 1454287309 0
> #      Mon Feb 01 00:41:49 2016 +0000
> # Branch stable
> # Node ID cf775b5fa387784ad4468a9bb1fb60a554a7977e
> # Parent  656e33b198f29f222c54e6eb546f5ecea8928c64
> debugrevlog: add bundle

why do you need to add a bundle?
Yuya Nishihara - Feb. 1, 2016, 1:40 p.m.
On Mon, 1 Feb 2016 12:19:54 +0000, Pierre-Yves David wrote:
> On 02/01/2016 07:29 AM, timeless wrote:
> > # HG changeset patch
> > # User timeless <timeless@mozdev.org>
> > # Date 1454287309 0
> > #      Mon Feb 01 00:41:49 2016 +0000
> > # Branch stable
> > # Node ID cf775b5fa387784ad4468a9bb1fb60a554a7977e
> > # Parent  656e33b198f29f222c54e6eb546f5ecea8928c64
> > debugrevlog: add bundle
> 
> why do you need to add a bundle?

That is because we can't create an empty entry at the beginning of manifest
by recent hg versions. We'll need a bundle or an extension to reproduce
the issue5062.

https://selenic.com/repo/hg/rev/301725c3df9a
https://bz.mercurial-scm.org/show_bug.cgi?id=5062

I don't think the whole series will fit to stable. I would send the fixes of
"debugdeltachain" and "debugrevlog -d" for stable, and the others for default,
which seem less important.

Patch

diff --git a/tests/bundles/issue5062.hg b/tests/bundles/issue5062.hg
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..4ab60c676af49435fd7f8761d7e91f8bd2e8de9b
GIT binary patch
literal 360
zc$@)f0hj(rM=~$~000g{Z*6dLWpi_BZ*Dz8T0&ZAIWa+5CR16qrt7l+00sZw_?`p;
zL<j%yYTMEPzwQ5^3jh%U0CWN%A_xK?Kv6IN`(}hGJrU@DG|&wI28@Fs00Yth4^XOm
zN`9hb$OeD_X`!G7gVX~c13&{%nvY1)qd?GlfB*mh00w{nqF1wt;XoECH?m+rsXz-9
ziNd{??V4!P;wMS3_9j!!eKAw!jP%q%m9#Lq!8mZGK{S(*BBJ?3Y>1RZ!~i-00W=G3
zK^00yR9Q6>c>If$A7*R9;EJ!1kP}>WoH;RKZ}6CRjW2_nR=6K_8r2D8+F)bNCUh}a
zD57hSOLe45!BgK}JV>t_=mvEq<3$7sMOC*S0A14o3Nj8=2QXumaOE(|)SpRgH|VH9
zK!jnfgk&;cf)j`t9a%{qMIfkglY3ubPM>po936!J9**x`#O?{i=M_MIi@744C`emV
Gb=iP~qL29i

diff --git a/tests/test-debugcommands.t b/tests/test-debugcommands.t
--- a/tests/test-debugcommands.t
+++ b/tests/test-debugcommands.t
@@ -20,26 +20,48 @@ 
   
   (use "hg debugrevlog -h" to show more help)
   [255]
-  $ echo a > a
-  $ hg ci -Am adda
-  adding a
   $ hg commit --config ui.allowemptycommit=True -m 'empty'
   $ hg debugrevlog -c -d
   # rev p1rev p2rev start   end deltastart base   p1   p2 rawsize totalsize compression heads chainlen
-      0    -1    -1     0    58          0    0    0    0      57        57           0     1        0
-      1     0    -1    58    87          0    0    0    0      56       113           1     1        1
+      0    -1    -1     0    28          0    0    0    0      56        56           2     1        0
   $ hg rollback
-  repository tip rolled back to revision 0 (undo commit)
-  working directory now based on revision 0
+  repository tip rolled back to revision -1 (undo commit)
+  working directory now based on revision -1
+  $ hg unbundle -q "$TESTDIR/bundles/issue5062.hg"
   $ hg debugrevlog -m
   format : 1
   flags  : inline, generaldelta
   
-  revisions     :  1
+  revisions     : 1
+      merges    : 0 ( 0.00%)
+      normal    : 1 (100.00%)
+  revisions     : 1
+      full      : 1 (100.00%)
+      deltas    : 0 ( 0.00%)
+  revision size : 0
+      full      : 0 (100.00%)
+      deltas    : 0 (100.00%)
+  
+  avg chain length  : 0
+  max chain length  : 0
+  compression ratio : 1
+  
+  uncompressed data size (min/max/avg) : 0 / 0 / 0
+  full revision size (min/max/avg)     : 0 / 0 / 0
+  delta size (min/max/avg)             : 0 / 0 / 0
+  $ echo a > a
+  $ hg ci -Am adda
+  adding a
+  created new head
+  $ hg debugrevlog -m
+  format : 1
+  flags  : inline, generaldelta
+  
+  revisions     :  2
       merges    :  0 ( 0.00%)
-      normal    :  1 (100.00%)
-  revisions     :  1
-      full      :  1 (100.00%)
+      normal    :  2 (100.00%)
+  revisions     :  2
+      full      :  2 (100.00%)
       deltas    :  0 ( 0.00%)
   revision size : 44
       full      : 44 (100.00%)
@@ -49,38 +71,54 @@ 
   max chain length  : 0
   compression ratio : 0
   
-  uncompressed data size (min/max/avg) : 43 / 43 / 43
-  full revision size (min/max/avg)     : 44 / 44 / 44
+  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
 
 Test debugindex, with and without the --debug flag
   $ hg debugindex a
      rev    offset  length  ..... linkrev nodeid       p1           p2 (re)
-       0         0       3   ....       0 b789fdd96dc2 000000000000 000000000000 (re)
+       0         0       3   ....       1 b789fdd96dc2 000000000000 000000000000 (re)
   $ hg --debug debugindex a
      rev    offset  length  ..... linkrev nodeid                                   p1                                       p2 (re)
-       0         0       3   ....       0 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 (re)
+       0         0       3   ....       1 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 (re)
   $ hg debugindex -f 1 a
      rev flag   offset   length     size  .....   link     p1     p2       nodeid (re)
-       0 0000        0        3        2   ....      0     -1     -1 b789fdd96dc2 (re)
+       0 0000        0        3        2   ....      1     -1     -1 b789fdd96dc2 (re)
   $ hg --debug debugindex -f 1 a
      rev flag   offset   length     size  .....   link     p1     p2                                   nodeid (re)
-       0 0000        0        3        2   ....      0     -1     -1 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 (re)
+       0 0000        0        3        2   ....      1     -1     -1 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 (re)
 
 debugdelta chain basic output
 
   $ hg debugdeltachain -m
       rev  chain# chainlen     prev   delta       size    rawsize  chainsize     ratio   lindist extradist extraratio
-        0       1        1       -1    base         44         43         44   1.02326        44         0    0.00000
+        0       1        1       -1    base          0          0          0   0.00000         0         0    0.00000
+        1       2        1       -1    base         44         43         44   1.02326        44         0    0.00000
 
   $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen}\n'
   0 1 1
+  1 2 1
 
   $ hg debugdeltachain -m -Tjson
   [
    {
     "chainid": 1,
     "chainlen": 1,
+    "chainratio": 0,
+    "chainsize": 0,
+    "compsize": 0,
+    "deltatype": "base",
+    "extradist": 0,
+    "extraratio": 0,
+    "lindist": 0,
+    "prevrev": -1,
+    "rev": 0,
+    "uncompsize": 0
+   },
+   {
+    "chainid": 2,
+    "chainlen": 1,
     "chainratio": 1.02325581395,
     "chainsize": 44,
     "compsize": 44,
@@ -89,7 +127,7 @@ 
     "extraratio": 0.0,
     "lindist": 44,
     "prevrev": -1,
-    "rev": 0,
+    "rev": 1,
     "uncompsize": 43
    }
   ]