okcompute / p4clean

Python script for resuming a perforce working directory to its original states

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Windows 7 symlinks are not detected

okcompute opened this issue · comments

On Windows 7, we have a use case where a symlink is created inisde the Perforce workspace that points to files in the same workspace. P4clean clean detect these files as untracked and will deleted them. P4clean should not erase symlinked files.

Note: os.path.issymling() for Python 2.7 under windows always return False. First functioning implementation was introduced in python 3.2. Needs to find a way to go around this limitation!

I decided to not touch symlinks folder for now on Windows. Because is slows down the process a lot. To do this cleanly, I need to parse all folders and tree and find the symlinked folders. If the files are under a symlinked folder and this folder is not tracked by Perforce, don't erase the files, just delete the symlink directory (Otherwise the target files will be erased and it is probably not something wanted).

If we change the main process loop to erase untracked folders instead of going file by file, this could be easier to do. But then, we have the problem to make sure a file under the folder tree is not excluded!

This needs more thought!

I'll keep it open...

Also this is linked to #10 issue in some way.