It seems we currently produce an empty command line and then decide to
not run it, but it seems better to skip that part too.
Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
It seems we currently produce an empty command line and then decide to
not run it, but it seems better to skip that part too.
| Lint Skipped |
| Unit Tests Skipped |
| Path | Packages | |||
|---|---|---|---|---|
| M | hgext/fix.py (6 lines) | |||
| M | tests/test-fix.t (2 lines) |
| Commit | Parents | Author | Summary | Date |
|---|---|---|---|---|
| ec5ad6ec2964 | 4152fedf1b9f | Martin von Zweigbergk | Jul 26 2019, 11:43 AM |
| Status | Author | Revision | |
|---|---|---|---|
| Closed | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz |
| linerange = ui.config(b'fix', name + b':linerange') | linerange = ui.config(b'fix', name + b':linerange') | ||||
| priority = ui.configint(b'fix', name + b':priority') | priority = ui.configint(b'fix', name + b':priority') | ||||
| metadata = ui.configbool(b'fix', name + b':metadata') | metadata = ui.configbool(b'fix', name + b':metadata') | ||||
| skipclean = ui.configbool(b'fix', name + b':skipclean') | skipclean = ui.configbool(b'fix', name + b':skipclean') | ||||
| # Don't use a fixer if it has no pattern configured. It would be | # Don't use a fixer if it has no pattern configured. It would be | ||||
| # dangerous to let it affect all files. It would be pointless to let it | # dangerous to let it affect all files. It would be pointless to let it | ||||
| # affect no files. There is no reasonable subset of files to use as the | # affect no files. There is no reasonable subset of files to use as the | ||||
| # default. | # default. | ||||
| if pattern is None: | if command is None: | ||||
| ui.warn( | |||||
| _(b'fixer tool has no command configuration: %s\n') % (name,) | |||||
| ) | |||||
| elif pattern is None: | |||||
| ui.warn( | ui.warn( | ||||
| _(b'fixer tool has no pattern configuration: %s\n') % (name,) | _(b'fixer tool has no pattern configuration: %s\n') % (name,) | ||||
| ) | ) | ||||
| elif not enabled: | elif not enabled: | ||||
| ui.debug(b'ignoring disabled fixer tool: %s\n' % (name,)) | ui.debug(b'ignoring disabled fixer tool: %s\n' % (name,)) | ||||
| else: | else: | ||||
| fixers[name] = Fixer( | fixers[name] = Fixer( | ||||
| command, pattern, linerange, priority, metadata, skipclean | command, pattern, linerange, priority, metadata, skipclean | ||||
| $ printf "foo" > foo | $ printf "foo" > foo | ||||
| $ printf "bar" > bar | $ printf "bar" > bar | ||||
| $ hg add -q | $ hg add -q | ||||
| $ hg fix --debug --working-dir --config "fix.nopattern:command=echo fixed" | $ hg fix --debug --working-dir --config "fix.nopattern:command=echo fixed" | ||||
| fixer tool has no pattern configuration: nopattern | fixer tool has no pattern configuration: nopattern | ||||
| $ cat foo bar | $ cat foo bar | ||||
| foobar (no-eol) | foobar (no-eol) | ||||
| $ hg fix --debug --working-dir --config "fix.nocommand:pattern=foo.bar" | |||||
| fixer tool has no command configuration: nocommand | |||||
| $ cd .. | $ cd .. | ||||
| Tools can be disabled. Disabled tools do nothing but print a debug message. | Tools can be disabled. Disabled tools do nothing but print a debug message. | ||||
| $ hg init disabled | $ hg init disabled | ||||
| $ cd disabled | $ cd disabled | ||||