diff tests/test-generaldelta.t @ 19764:e92650e39f1c stable

generaldelta: initialize basecache properly Previously basecache was incorrectly initialized before adding the first revision from a changegroup. Basecache value influences when full revisions are stored in revlog (when using generaldelta). As a result it was possible to generate a generaldelta-revlog that could be bigger by arbitrary factor than its non-generaldelta equivalent.
author Wojciech Lopata <lopek@fb.com>
date Fri, 20 Sep 2013 10:45:51 -0700
parents
children 4d2bea6604d3
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-generaldelta.t	Fri Sep 20 10:45:51 2013 -0700
@@ -0,0 +1,23 @@
+Check whether size of generaldelta revlog is not bigger than its
+regular equivalent. Test would fail if generaldelta was naive
+implementation of parentdelta: third manifest revision would be fully
+inserted due to big distance from its paren revision (zero).
+
+  $ hg init repo
+  $ cd repo
+  $ echo foo > foo
+  $ echo bar > bar
+  $ hg commit -q -Am boo
+  $ hg clone --pull . ../gdrepo -q --config format.generaldelta=yes
+  $ for r in 1 2 3; do
+  >   echo $r > foo
+  >   hg commit -q -m $r
+  >   hg up -q -r 0
+  >   hg pull . -q -r $r -R ../gdrepo
+  > done
+  $ cd ..
+  $ regsize=`du -s -b repo/.hg/store/00manifest.i | cut -f 1`
+  $ gdsize=`du -s -b gdrepo/.hg/store/00manifest.i | cut -f 1`
+  $ if ((regsize < gdsize)); then
+  >   echo 'generaldelta increased size of a revlog!'
+  > fi