test-flagprocessor: add tests about bundlerepo
authorJun Wu <quark@fb.com>
Thu, 06 Apr 2017 17:24:36 -0700
changeset 31833 723c1ab2f77e
parent 31832 77f746e5383a
child 31834 433ab46f6bb4
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.
tests/test-flagprocessor.t
--- a/tests/test-flagprocessor.t	Thu Apr 06 17:23:20 2017 -0700
+++ b/tests/test-flagprocessor.t	Thu Apr 06 17:24:36 2017 -0700
@@ -163,3 +163,36 @@
   $ hg commit -Aqm 'add file'
   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!