Mercurial > hg
comparison tests/test-fix.t @ 43058:808a57a08470
fix: add :enabled sub-config for fixer tools
This allows distributing opt-in fixer tool configurations in .hgrc
files. This may be useful for adding default configs in core, or for
orgranizations that want to provide configs to their users.
Tools are still enabled by default because it would be confusing to add a
config and find that it has no effect until you add enabled=true.
Differential Revision: https://phab.mercurial-scm.org/D6975
author | Danny Hooper <hooper@google.com> |
---|---|
date | Sat, 05 Oct 2019 07:10:34 -0700 |
parents | a2dffe68b4ea |
children | d3d1a3afe7aa |
comparison
equal
deleted
inserted
replaced
43057:c5c502bd1f70 | 43058:808a57a08470 |
---|---|
1339 $ cat foo bar | 1339 $ cat foo bar |
1340 foobar (no-eol) | 1340 foobar (no-eol) |
1341 | 1341 |
1342 $ cd .. | 1342 $ cd .. |
1343 | 1343 |
1344 Tools can be disabled. Disabled tools do nothing but print a debug message. | |
1345 | |
1346 $ hg init disabled | |
1347 $ cd disabled | |
1348 | |
1349 $ printf "foo\n" > foo | |
1350 $ hg add -q | |
1351 $ hg fix --debug --working-dir --config "fix.disabled:command=echo fixed" \ | |
1352 > --config "fix.disabled:pattern=foo" \ | |
1353 > --config "fix.disabled:enabled=false" | |
1354 ignoring disabled fixer tool: disabled | |
1355 $ cat foo | |
1356 foo | |
1357 | |
1358 $ cd .. | |
1359 | |
1344 Test that we can configure a fixer to affect all files regardless of the cwd. | 1360 Test that we can configure a fixer to affect all files regardless of the cwd. |
1345 The way we invoke matching must not prohibit this. | 1361 The way we invoke matching must not prohibit this. |
1346 | 1362 |
1347 $ hg init affectallfiles | 1363 $ hg init affectallfiles |
1348 $ cd affectallfiles | 1364 $ cd affectallfiles |