This is an archive of the discontinued Mercurial Phabricator instance.

examples: allow the fix configuration to work from any directory
AbandonedPublic

Authored by mharbison72 on Oct 12 2019, 12:55 AM.

Details

Reviewers
None
Group Reviewers
hg-reviewers
Summary

Generally my shell is in the tests directory, and there was no sign that fix
wasn't doing anything, even with --debug and without --quiet on the grey
invocation. (Maybe it would be useful to state when no files were processed?)
I only tested the black config, but the others are similar enough.

The need for a different command based on the platform is a bit unfortunate. I
wonder if it's worth a {python} keyword for portability, since the python
binary isn't in PATH by default on Windows (IIRC), and doesn't have the version
number in any case.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

mharbison72 created this revision.Oct 12 2019, 12:55 AM

It's unfortunate that this is necessary. I'll see if I can fix fix.py to always interpret patterns relative to the repo root.

It's unfortunate that this is necessary. I'll see if I can fix fix.py to always interpret patterns relative to the repo root.

I think that's the most intuitive way to consume these patterns. But won't that muddy the water with the documentation saying, for example, that glob: is relative to cwd? Also, there's relative patterns in the file pattern to consider. (I'm not against your proposal at all; I'm just wondering aloud because I always get tripped up by the slightly modified ignore rules.)

I found debugwalk to be useful in figuring this out. I wonder if it's worth a mention in hg help patterns.

It's unfortunate that this is necessary. I'll see if I can fix fix.py to always interpret patterns relative to the repo root.

I think that's the most intuitive way to consume these patterns. But won't that muddy the water with the documentation saying, for example, that glob: is relative to cwd? Also, there's relative patterns in the file pattern to consider. (I'm not against your proposal at all; I'm just wondering aloud because I always get tripped up by the slightly modified ignore rules.)

I talked to @hooper about this and they agreed that using repo-relative paths is almost always what the user wants. I've sent D7101 for that.

mharbison72 abandoned this revision.Oct 14 2019, 9:19 PM

I talked to @hooper about this and they agreed that using repo-relative paths is almost always what the user wants. I've sent D7101 for that.

Sounds good to me.