Issue2077

Title Hg on Windows does not reconcile files with : in the filename
Priority bug Status done-cbb
Superseder Nosy List abuehl, danchr, mpm, tmyoung
Assigned To Topics

Created on 2010-03-09.06:56:48 by tmyoung, last changed 2012-02-01.00:13:56 by mpm.

Messages
msg18854 (view) Author: mpm Date: 2012-02-01.00:13:56
Not a bug.
msg12035 (view) Author: danchr Date: 2010-03-12.22:05:03
Wouldn't it be preferable to simple ignore files with invalid file names, 
rather than failing the entire update? Coupled with a suitable warning, this 
would inform the users of the issue, but allow them to continue using the 
repository.
msg11976 (view) Author: tmyoung Date: 2010-03-09.17:25:20
Then why did it remap it for one folder but not the other?
msg11975 (view) Author: abuehl Date: 2010-03-09.17:22:50
No. We are not going to try to remap filenames in the working dir with 
Mercurial.
msg11973 (view) Author: tmyoung Date: 2010-03-09.16:40:05
I am aware that Windows reserves that character for that reason, but Samba
and similar systems can rename the file or list it under a name similar to
the 8.3 file-naming system from DOS that allows the file to be accessed and
saved on windows clients, the file name appears as "A4CXQF~9.3PM" and can be
edited, and when it is opened on the host Linux machine, it has the original
name.  Ensuring this happens would prevent the error message from occurring.

In looking through my repository, I have two copies of these files in my
repository: Windows allowed one of the sets and renamed the files according
to the specification above, but the other folder, with the exact same
contents, failed.  I couldn't tell why it worked in one folder but not another.

Thank you for the link to the CaseGuard hook, I will definitely look into
it, but with the solution mentioned above, perhaps there is a workaround
that would entirely prevent this from happening.
msg11957 (view) Author: abuehl Date: 2010-03-09.08:34:29
@tmyoung: you can find the rules for forming valid filenames on Windows at 
http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx

Colon (:) is not a valid character for a filename on Windows (it is reserved 
as a separator for the drive letter from the rest of the path, e.g. 
"C:\myrepository\this\a\valid\windows\file.txt")

http://en.wikipedia.org/wiki/Drive_letter

There's no version of Mercurial (as of 1.5) that would warn you about adding 
such files on Linux, but it is possible to create an extension or hook that 
does this. For example, Alexandru Totoliciis has been working on 
http://mercurial.selenic.com/wiki/CaseGuardExtension which IIRC should warn 
about colons in filenames (give it a try if you're interested).
msg11956 (view) Author: mpm Date: 2010-03-09.07:20:22
Guess what character isn't allowed in Windows filenames?
msg11955 (view) Author: tmyoung Date: 2010-03-09.06:56:48
I added Bugzilla to my repository, and with it can PERL man files like
"Authen::Radius.3pm"  These were successfully committed on my Linux machine,
but updating my Windows machine after a pull failed.  Hg first returned
"[Errno 22] The requested operation cannot be performed on a file with a
user-mapped section open"  Then I ran hg update -C, and it returned "abort:
Invalid file name [etc.]"  I removed the files on the Linux node, pushed
again, and the repository updated properly.

I am using hg 1.3.1 on Windows; I don't know if this has been fixed between
1.3.1 and 1.5, and I will update to 1.5 soon.
History
Date User Action Args
2012-02-01 00:13:56mpmsetstatus: chatting -> done-cbb
nosy: mpm, abuehl, danchr, tmyoung
messages: + msg18854
2010-03-12 22:05:03danchrsetstatus: done-cbb -> chatting
nosy: + danchr
messages: + msg12035
2010-03-09 18:08:37abuehlsetstatus: unread -> done-cbb
nosy: mpm, abuehl, tmyoung
2010-03-09 17:25:20tmyoungsetstatus: done-cbb -> unread
nosy: mpm, abuehl, tmyoung
messages: + msg11976
2010-03-09 17:22:50abuehlsetstatus: unread -> done-cbb
nosy: mpm, abuehl, tmyoung
messages: + msg11975
2010-03-09 16:40:05tmyoungsetstatus: done-cbb -> unread
nosy: mpm, abuehl, tmyoung
messages: + msg11973
2010-03-09 08:35:49abuehlsetstatus: chatting -> done-cbb
nosy: mpm, abuehl, tmyoung
2010-03-09 08:34:30abuehlsetstatus: done-cbb -> chatting
nosy: + abuehl
messages: + msg11957
2010-03-09 07:20:22mpmsetstatus: unread -> done-cbb
nosy: + mpm
messages: + msg11956
2010-03-09 06:56:48tmyoungcreate