Illegal Filesystem characters in revision names

John A Meinel john at arbash-meinel.com
Sat Dec 3 18:39:33 GMT 2005


I'm trying to figure out the best way to handle illegal characters in
revision names.
On windows, the forbidden characters in a filename are:
  \ / : * ? " < > |

There are also some forbidden strings, specifically you can never name a
file:
  prn
  com1, com2, com3, etc
  lpt1, lpt2, etc

I'm guessing there are others, but I haven't been able to find the
Microsoft Knowledge base article

The specific thing I'm worried about, is that we are trying to use
"Arch:" as a prefix for arch imported archives, and this prevents them
from being checked out on windows.

I can think of a few solutions:

1) Forbid illegal characters in revision names. People could always
switch to using Arch-some at archive%foo--baz--1.0--patch-2. But using a
semicolon to define a namespace is really nice.

2) URL encode illegal characters. This means that they would always have
a legal filesystem name. The question becomes, though, when do you turn
this on. Do you use it on all platforms, or just on windows? When you
request it, it actually has to be doubly encoded, since http would
decode it. If we don't use it everywhere, we still have to be able to
handle it, since some people will publish using an IIS server, and
others would use Apache.
An branch format bump could make this cleaner, and just everyone would
start using the new format.

3) Just switch to using a revision.weave file. Since revisions are no
longer saved directly by their name, we can break ourselves from being
limited to filesystem constraints. This would also require a branch
format bump. I'm hesitant to do this until we have knits. We already
have 1 file (inventory.weave) which scales by the number of commits, I
wouldn't really want to introduce a second one. (Though it would scale
better, since the number of lines per revision are much smaller).

Does anyone have more ideas? I'm leaning towards the third option, since
we kind of want to do it anyway. And I guess we can just say "arch
conversions aren't supported on windows until the next branch format".
Though it might be nice to get it sooner than that, since I've started
pointing my coworkers to bzr.

John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051203/5e4a2fa0/attachment.pgp 


More information about the bazaar mailing list