I was surprised fixer patterns (used to determine which fixers to run)
are applies to the parent directory, not the repo root
directory. Danny Hooper (the author of the extension) seemed to agree
that it's better to apply them to the repo root, so that's what this
patch does.
Details
Details
- Reviewers
mharbison72 pulkit - Group Reviewers
hg-reviewers - Commits
- rHGf02d3c0eed18: fix: match patterns relative to root
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
The part of the help text that documents :pattern and points to hg help patterns should probably explicitly state that they are all relative to repo root, regardless of what the latter says.
I can’t tell from my phone, but should the matcher in getworkqueue and the status call in pathstofix also be adjusted? (Not sure if there are others.)
Comment Actions
Good point! Done.
I can’t tell from my phone, but should the matcher in getworkqueue and the status call in pathstofix also be adjusted? (Not sure if there are others.)
No, that matcher (it's the same instance that's passed between them) is created based on pats and opts, i.e. command line arguments.
Comment Actions
Amended the following in flight:
diff --git a/tests/test-fix.t b/tests/test-fix.t --- a/tests/test-fix.t +++ b/tests/test-fix.t @@ -157,8 +157,10 @@ Help text for fix. :skipclean suboption to false. The :pattern suboption determines which files will be passed through each - configured tool. See 'hg help patterns' for possible values. If there are file - arguments to 'hg fix', the intersection of these patterns is used. + configured tool. See 'hg help patterns' for possible values. However, all + patterns are relative to the repo root, even if that text says they are + relative to the current working directory. If there are file arguments to 'hg + fix', the intersection of these patterns is used. There is also a configurable limit for the maximum size of file that will be processed by 'hg fix':