diff -r 6217180f9ab8 -r b33c0c38d68f mercurial/merge.py --- a/mercurial/merge.py Mon Jul 25 12:59:52 2016 +0800 +++ b/mercurial/merge.py Thu Jul 21 15:55:47 2016 -0700 @@ -1082,7 +1082,7 @@ if e.errno != errno.ENOENT: raise - if repo.wvfs.isdir(f): + if repo.wvfs.isdir(f) and not repo.wvfs.islink(f): repo.wvfs.removedirs(f) wwrite(f, fctx(f).data(), flags, backgroundclose=True) if i == 100: