windows: sanity-check symlink placeholders
On Windows, we store symlinks as plain files with the link contents.
Via user error or NFS/Samba assistance, these files often end up with
'normal' file contents. Committing these changes thus gives an
invalid symlink that can't be checked out on Unix.
Here we filter out any modified symlink placeholders that look
suspicious when computing status:
- more than 1K (looks more like a normal file)
- contain NULs (not allowed on Unix, probably a binary)
- contains \n (filenames can't contain \n, very unusual for symlinks,
very common for files)
hg debuginstall
$ hg debuginstall
Checking encoding (ascii)...
Checking installed modules (*/mercurial)... (glob)
Checking templates (*/mercurial/templates)... (glob)
Checking commit editor...
Checking username...
No problems detected
hg debuginstall with no username
$ HGUSER= hg debuginstall
Checking encoding (ascii)...
Checking installed modules (*/mercurial)... (glob)
Checking templates (*/mercurial/templates)... (glob)
Checking commit editor...
Checking username...
no username supplied (see "hg help config")
(specify a username in your configuration file)
1 problems detected, please check your install!
[1]