[PATCH 0 of 1] avoid deleting symbolically linked directories on windows

Henrik Stuart henrik.stuart at edlund.dk
Mon May 11 13:06:33 CDT 2009


Paul Moore skrev:
> 2009/5/11 Henrik Stuart <henrik.stuart at edlund.dk>:
>> So the fact that os.removedirs works as intended (i.e. doesn't try to
>> remove levels above the repository) is fairly incidental and due to the
>> fact that .hg is always there in the real directory.
> 
> Personally, I think this is the problem here. Surely we shouldn't be
> even attempting to remove the repository directory in the first place?

I agree.

> Relying on the facts that (a) rmdir doesn't work on a non-empty
> directory and (b) the repository root will always contain a .hg
> subdirectory, seems to be asking for trouble. This case shows (a)
> failing, and if someone ever implements a change to allow the .hg
> directory to be stored elsewhere, (b) would then fail too.
> 
> Better to fix the real problem here, in my view.

Definitely, but making util.unlink root-level aware is a fairly
substantial change. I might take a look at it soon, but until then,
fixing what's broken like this should have no adverse effects.

-- 
Kind regards,
  Henrik


More information about the Mercurial-devel mailing list