D6440: fix: let fixer tools inherit hg's cwd so they can look at the working copy

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Fri May 24 09:15:07 EDT 2019


durin42 added inline comments.

INLINE COMMENTS

> hooper wrote in 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".

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...

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6440

To: hooper, #hg-reviewers
Cc: durin42, mercurial-devel


More information about the Mercurial-devel mailing list