This is an archive of the discontinued Mercurial Phabricator instance.

fix: ignore fixer tool configurations that are missing patterns
ClosedPublic

Authored by hooper on Jul 24 2019, 7:39 PM.

Details

Summary

This is to prevent a crash under the same circumstances.

This is also to avoid data loss due to accidental application of a fixer tool
to all files, if the matching logic somehow changed to that effect. Affecting
all files until otherwise configured would be dangerous, and not very useful.

We shouldn't abort because there may be other fixers, and it may still be
useful to run them without having to adjust configuration. A user might not
feel confident in changing configs, for example.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

hooper created this revision.Jul 24 2019, 7:39 PM
martinvonz added inline comments.
hgext/fix.py
733–735

Is this change needed given the change above?

tests/test-fix.t
1258

nit: The --debug seems unnecessary, unless we want to make sure that we *don't* get any output.

hooper added inline comments.Jul 25 2019, 9:01 PM
hgext/fix.py
733–735

It makes this function more robust. It might be called by someone who actually tries to use a Fixer with no pattern.

tests/test-fix.t
1258

Yes, it will show a "subprocess: ...." line if we go ahead and use the fixer. The file also exists to make it possible to observe that kind of regression.

Keep in mind the fix command has no output until you set up hooks or something.

This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.