tests/bundles/test-revlog-diff-relative-to-nullrev.sh
author Arseniy Alekseyev <aalekseyev@janestreet.com>
Tue, 20 Sep 2022 13:38:07 -0400
branchstable
changeset 49492 b3e77d536b53
parent 49239 a94f28be2e6e
child 51046 f636103c4d67
permissions -rwxr-xr-x
tests: fix the flaky test test-logtoprocess.t The main change is that we're waiting for the [touched] file to appear for 5 seconds instead of 0.1 seconds. Also, instead of implementing wait-on-file from scratch, we use the existing one from testlib/ that works well.

#!/bin/bash
#
# Make sure to patch mercurial to create the delta against nullrev
#
# # Parent  cdb85d0512b81031d4a7b30d6a5ddbe69ef1a876
#
# diff --git a/mercurial/revlogutils/deltas.py b/mercurial/revlogutils/deltas.py
# --- a/mercurial/revlogutils/deltas.py
# +++ b/mercurial/revlogutils/deltas.py
# @@ -1117,7 +1117,10 @@ class deltacomputer:
#                  candidaterevs = next(groups)
#
#          if deltainfo is None:
# -            deltainfo = self._fullsnapshotinfo(fh, revinfo, target_rev)
# +            if revlog._generaldelta:
# +                deltainfo = self._builddeltainfo(revinfo, nullrev, fh)
# +            else:
# +                deltainfo = self._fullsnapshotinfo(fh, revinfo, target_rev)


cd "`dirname \"$0\"`"
export HGRCPATH=
export HGMODULEPOLICY=py

rm -rf nullrev-diff
../../hg init nullrev-diff  --config format.revlog-compression=zlib
cd nullrev-diff
echo hi > a
../../../hg commit -Am root-B
echo ho > a
../../../hg commit -Am child-A
hg up null
echo ha > a
../../../hg commit -Am root-A
../../../hg debugdeltachain a
rm -rf .hg/cache/ .hg/wcache/
cd ..

tar cf test-revlog-diff-relative-to-nullrev.tar nullrev-diff

rm -rf nullrev-diff