When clearing unknown files to remove path conflicts, also delete files that
conflict with the target file's path.
Details
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Event Timeline
tests/test-pathconflicts-basic.t | ||
---|---|---|
38 | I don't know about these ~hash files, but including the + in the name definitely seems wrong. |
tests/test-pathconflicts-basic.t | ||
---|---|---|
38 | I will strip the + characters. I didn't know these caused problems on Windows. |
mercurial/context.py | ||
---|---|---|
1979 | This breaks test-audit-path.t on macOS. In the test "attack /tmp/test", we call this codepath with f == '/tmp/test'. util.finddirs finds '/tmp', which on macOS is a symlink to /private/tmp, so L1940 is true and on L1941 we try to unlink /tmp. @mbthomas Is it intentional that we try to unlink symlinks to directories here? If not, we can fix this with: - if wvfs.isfileorlink(p): + if wvfs.isfileorlink(p) and not wvfs.isdir(p): |
This breaks test-audit-path.t on macOS. In the test "attack /tmp/test", we call this codepath with f == '/tmp/test'. util.finddirs finds '/tmp', which on macOS is a symlink to /private/tmp, so L1940 is true and on L1941 we try to unlink /tmp.
@mbthomas Is it intentional that we try to unlink symlinks to directories here? If not, we can fix this with: