-
Notifications
You must be signed in to change notification settings - Fork 92
Description
Hello,
I would like to report a potential issue where the Microsoft Office cleanup routine may inadvertently damage data belonging to Mercurial, a source control management tool.
The problematic rule targets temporary Office files starting with a tilde (~):
[Microsoft Office *]
...
FileKey32=%UserProfile%\Documents|~*.ppt*;~*.doc*|RECURSE
...
The Problem:
When a Mercurial repository is created inside %UserProfile%\Documents and contains a file with non-English characters (e.g., тест.doc), Mercurial stores it in its internal data folder (.hg\store\data\) with escaped filenames, such as:
~f2~e5~f1~f2.doc.i
These files are not temporary Office files, but the cleanup routine mistakenly identifies them as such because their names begin with a tilde (~f2...). This could lead to data loss in a Mercurial repository. Here is the example of such repository:
https://files.chemtable.com/special/test_repo.zip
Proposed Solution:
I suggest adding the following exclusions to the Microsoft Office routine to protect Mercurial's escaped files:
ExcludeKey7=PATH|%UserProfile%\Documents\*\|~*.ppt*.*
ExcludeKey8=PATH|%UserProfile%\Documents\*\|~*.doc*.*
Even better and simpler would be to exclude the entire .hg subfolder, but I have not found a way to achieve this with the current ExcludeKey syntax. The following attempt does not work for nested subfolders (at least in my implementation of a Winapp2 parser; it has not been tested in CCleaner or other supporting tools):
ExcludeKey7=PATH|%UserProfile%\Documents\*.hg*\*\|*.*