$ foo=bar hg root fails to recognise the repo $foo. I stopped expanding env
vars from vfs when there exists a repo with the same name as the env var.
Details
- Reviewers
baymax - Group Reviewers
hg-reviewers
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Event Timeline
def __init__(self, base, audit=True, cacheaudited=False, expandpath=False, realpath=False):+ if '$' in base and os.path.isdir(base):
+ # when there exists a repo '$foo' and an env var foo=bar, stop
+ # expanding path. refer issue5739.
+ expandpath = False
This is logically incorrect. The problem is that we're doing variable
expansion at too lower layer. vfs(expand(user_specified_path)) makes
some sense, but vfs(expand(getcwd())) is clearly wrong. And the vfs class
can't know where the base comes from.
This is logically incorrect. The problem is that we're doing variable
expansion at too lower layer. vfs(expand(user_specified_path)) makes
some sense, but vfs(expand(getcwd())) is clearly wrong. And the vfs class
can't know where the base comes from.
If I add a condition for expanding env var if present in hgrc, can this work as a fix?
If the only solution for this is shifting path expansion from vfs class, where do you
think it can be?
> This is logically incorrect. The problem is that we're doing variable > expansion at too lower layer. `vfs(expand(user_specified_path))` makes > some sense, but `vfs(expand(getcwd()))` is clearly wrong. And the vfs class > can't know where the `base` comes from. If I add a condition for expanding env var if present in `hgrc`, can this work as a fix?
Maybe no. Where do you intend to add such code? vfs doesn't know where the path
comes from. Neither does localrepo.
If the only solution for this is shifting path expansion from `vfs` class, where do you think it can be?
Somewhere specifying repository path read from hgrc or user input.
There seems to have been no activities on this Diff for the past 3 Months.
By policy, we are automatically moving it out of the need-review state.
Please, move it back to need-review without hesitation if this diff should still be discussed.
:baymax:need-review-idle: