D785: context: also consider path conflicts when clearing unknown files

swhitaker (Simon Whitaker) phabricator at mercurial-scm.org
Mon Oct 16 15:17:31 EDT 2017


swhitaker added inline comments.

INLINE COMMENTS

> context.py:1941
> +            if wvfs.isfileorlink(p):
> +                wvfs.unlink(p)
> +                break

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):

REPOSITORY
  rHG Mercurial

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

To: mbthomas, #hg-reviewers, ryanmce
Cc: swhitaker, ryanmce, kiilerix, mercurial-devel


More information about the Mercurial-devel mailing list