This lets fixer tools do things like find configuration files, with the caveat
that they'll only see the version of that file in the working copy, regardless
of what revisions are being fixed.
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHG74b4cd091e0d: fix: run fixer tools in the repo root as cwd so they can use the working copy
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
hgext/fix.py | ||
---|---|---|
106 | I wonder if it'd be more generally useful to run the fixer in the repo root than the same pwd as the command invocation. WDYT? |
hgext/fix.py | ||
---|---|---|
106 | It depends on whether we want to make it easier for tools that want to examine the tree upward from the cwd or tools that want to examine the tree downward from the root. I suspect that "upward" will be more important because of the way some tools use config files that apply to subtrees. For some tools it's weird because reading code to format from stdin is often an afterthought. Either way, for completeness, the root and cwd would both need to be available in either subprocess cwd or the command template. There may also be some room to prefer configs like "cd {root} && mycommand". |
hgext/fix.py | ||
---|---|---|
106 | Hm. Is {root} in the templater for the command? Maybe have a sample in the test demonstrating that? I'm still dubious that cwd is the right thing, simply because it's unpredictable. I could see $(dirname filepath) or repo root as consistent, but cwd feels off to me somehow. I don't feel strongly though, so as long as {root} exists I can get what I need for hg's fixer definitions... |
hgext/fix.py | ||
---|---|---|
106 | FWIW, I agree that running using cwd-relative path feels wrong. |
I still think we should fix the cwd for fixers, but it seems Martin and I agree that repo-root is more consistent. Would you be willing to reroll with repo-root instead of cwd?
I wonder if it'd be more generally useful to run the fixer in the repo root than the same pwd as the command invocation. WDYT?