windows: avoid deleting non-empty reparse points
If a hg repository including working directory is a reparse point (directory
symlinked or a junction point), then using os.removedirs will remove the
reparse point erroneously. This is fixed by only removing directories if they
are empty.
% ghost revisions
initializing destination source-hg repository
scanning source...
sorting...
converting...
1 Initial layout setup
0 Commit with ghost revision
o 1 "Commit with ghost revision" files: somefile
|
o 0 "Initial layout setup" files: somefile