[PATCH 3 of 8] test-flagprocessor: add tests about bundlerepo

Jun Wu quark at fb.com
Thu Apr 6 22:08:11 EDT 2017


# HG changeset patch
# User Jun Wu <quark at fb.com>
# Date 1491524676 25200
#      Thu Apr 06 17:24:36 2017 -0700
# Node ID 2a254e0cac392c1e0af8bbf0645ecb02b2352f8c
# Parent  f9c75f4ee30e0102d8fb5a65eaee988e7ca30139
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 2a254e0cac39
test-flagprocessor: add tests about bundlerepo

This shows flag processor is broken with a bundle repo.

The test creates non-liner history to exercise code path where the
deltaparent cannot be reused.

diff --git a/tests/test-flagprocessor.t b/tests/test-flagprocessor.t
--- a/tests/test-flagprocessor.t
+++ b/tests/test-flagprocessor.t
@@ -164,2 +164,35 @@
   abort: cannot register multiple processors on flag '0x8'.
   [255]
+
+  $ cd ..
+
+# TEST: bundle repo
+  $ hg init bundletest
+  $ cd bundletest
+
+  $ cat >> .hg/hgrc << EOF
+  > [extensions]
+  > flagprocessor=$TESTDIR/flagprocessorext.py
+  > EOF
+
+  $ for i in 0 single two three 4; do
+  >   echo '[BASE64]a-bit-longer-'$i > base64
+  >   hg commit -m base64-$i -A base64
+  > done
+
+  $ hg update 2 -q
+  $ echo '[BASE64]a-bit-longer-branching' > base64
+  $ hg commit -q -m branching
+
+  $ hg bundle --base 1 bundle.hg
+  4 changesets found
+  $ hg --config extensions.strip= strip -r 2 --no-backup --force -q
+  $ hg -R bundle.hg log --stat -T '{rev} {desc}\n' base64 2>&1 | egrep -v '^(\*\*|  )'
+  Traceback (most recent call last):
+  mercurial.mpatch.mpatchError: invalid patch
+
+  $ hg bundle -R bundle.hg --base 1 bundle-again.hg -q 2>&1 | egrep -v '^(\*\*|  )'
+  Traceback (most recent call last):
+  TypeError: Incorrect padding
+  $ hg -R bundle-again.hg log --stat -T '{rev} {desc}\n' base64 2>&1 | egrep -v '^(\*\*|  )'
+  abort: repository bundle-again.hg not found!


More information about the Mercurial-devel mailing list