This allows users to stop and address tool failures before proceeding, instead
of the default behavior of continuing to apply any tools that didn't fail. For
example, a code formatting tool could fail if you have syntax errors, and you
might want your repo to stay in its current state while you fix the syntax
error before re-running 'hg fix'. It's conceivable that this would even be
necessary for the correctness of some fixer tools across a chain of revisions.
Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHG93bab80993f4: fix: add a config to abort when a fixer tool fails
Diff Detail
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
Comment Actions
Looks good, but test-check-config.t failed probably because the doc couldn't
be found by the checker.
@@ -464,9 +488,14 @@
showstderr(ui, fixctx.rev(), fixername, stderr) if proc.returncode == 0: newdata = newerdata
- elif not stderr:
- showstderr(ui, fixctx.rev(), fixername,
- _('exited with status %d\n') % (proc.returncode,))
+ else:
+ if not stderr:
+ message = _('exited with status %d\n') % (proc.returncode,)
+ showstderr(ui, fixctx.rev(), fixername, message)
+ checktoolfailureaction(
+ ui, _('no fixes will be applied'),
+ hint=_('use --config fix.failure=continue to apply any '
+ 'successful fixes anyway'))
This runs after fork(), but it should work as long as no user interaction is
required.