comparison tests/test-flagprocessor.t @ 33614:41081364addb stable

tests: clarify that duplicate flag processors is not an error The flag processors test for duplicate processors for a single flag was misleading because the file from the previous test case caused it to fail (making the "echo 'this should fail' > file" part irrelevant). Let's remove the leftover from the previous test case to make it clear that duplicate flag processors results only in a warning. Note that duplicate flag processors would have resulted in a failure (not just a warning) until ea1c2eb7abd3 (extensions: catch uisetup and extsetup failures and don't let them break hg, 2017-06-06). I remember expressing my concern about ending up with half-loaded extensions. It would be pretty unfortunate to have double-encoded revlog content enter a repo, so maybe we should reconsider? Differential Revision: https://phab.mercurial-scm.org/D201
author Martin von Zweigbergk <martinvonz@google.com>
date Mon, 31 Jul 2017 16:40:31 -0700
parents ea1c2eb7abd3
children c6146dd10072
comparison
equal deleted inserted replaced
33613:3b77d4787c18 33614:41081364addb
150 # TEST: ensure a missing processor is handled 150 # TEST: ensure a missing processor is handled
151 $ echo '[FAIL][BASE64][GZIP][NOOP]' > fail-base64-gzip-noop 151 $ echo '[FAIL][BASE64][GZIP][NOOP]' > fail-base64-gzip-noop
152 $ hg commit -Aqm 'fail+base64+gzip+noop' 152 $ hg commit -Aqm 'fail+base64+gzip+noop'
153 abort: missing processor for flag '0x1'! 153 abort: missing processor for flag '0x1'!
154 [255] 154 [255]
155 $ hg forget fail-base64-gzip-noop
156 $ rm fail-base64-gzip-noop
155 157
156 # TEST: ensure we cannot register several flag processors on the same flag 158 # TEST: ensure we cannot register several flag processors on the same flag
157 $ cat >> .hg/hgrc << EOF 159 $ cat >> .hg/hgrc << EOF
158 > [extensions] 160 > [extensions]
159 > extension=$TESTDIR/flagprocessorext.py 161 > extension=$TESTDIR/flagprocessorext.py
160 > duplicate=$TESTDIR/flagprocessorext.py 162 > duplicate=$TESTDIR/flagprocessorext.py
161 > EOF 163 > EOF
162 $ echo 'this should fail' > file 164 $ echo 'this should fail' > file
163 $ hg commit -Aqm 'add file' 165 $ hg commit -Aqm 'add file'
164 *** failed to set up extension duplicate: cannot register multiple processors on flag '0x8'. 166 *** failed to set up extension duplicate: cannot register multiple processors on flag '0x8'.
165 abort: missing processor for flag '0x1'!
166 [255]
167 167
168 $ cd .. 168 $ cd ..
169 169
170 # TEST: bundle repo 170 # TEST: bundle repo
171 $ hg init bundletest 171 $ hg init bundletest