Comment 23 for bug 81844

Revision history for this message
Richard Wilbur (richard-wilbur) wrote : Re: [Bug 81844] Re: backslash in filename causes InvalidEntryName etc

On Sat, Jan 13, 2018 at 10:40 PM, Jelmer Vernooij
<email address hidden> wrote:
> Bazaar already encodes path separators in unix style (i.e. a forward
> slash), and will transform backslashes on Windows as necessary.

Yes, I'm glad that part already works.

> I don't think Windows allows forward slashes in filenames either.

It doesn't seem to like it in a filename. Depending on context it
either says it can't find the corresponding path (treats it as a path
separator) or invalid option.
C:\> echo "Test" >"test/1.txt"
The system cannot find the path specified.

C:\Users\User>dir Documents/Fax
Invalid switch - "Fax".

C:\Users\User>dir "Documents/Fax"
 Volume in drive C is Local Disk
 Volume Serial Number is ####-####

 Directory of C:\Users\User\Documents\Fax
[...]

> Either way, replacing backslashes in filenames with forward slashes (or
> another character) is a bad idea IMO. It's confusing, and unlikely to be
> the behaviour that users actually want. Users that care about
> portability to Windows can just avoid using backslashes in their
> filenames.

So, it seems we should give people a strong warning about the lack of
portability of such filenames to Windows but some people seem to want
to still use them. The warning should appear when the user is adding
(naming) or renaming a file to a name that exhibits this problem.
Should we allow them to use such broken names because their
application calls for it?

I guess it would be nice if there were some way to modify a branch
under Windows so it was usable if it had come from a branch created
with an offending filename.