backslash in file names

Ben Finney bignose+hates-spam at benfinney.id.au
Thu Oct 23 02:31:49 BST 2008


"Martin Pool" <mbp at canonical.com> writes:

> On Thu, Oct 23, 2008 at 10:09 AM, Jelmer Vernooij <jelmer at samba.org> wrote:
> >> Could we change the check in inventory.py so that when it
> >> encounters a backslash it emits a warning rather than signalling
> >> an error?
> > fwiw, there is a bug open about this, 81844:
> > https://bugs.edge.launchpad.net/bzr/+bug/81844
> 
> I think it would be reasonable to accept those names and just refuse
> to checkout the tree on platforms that don't support it.

I think you would be better saying “… on filesystems that don't
support it”. The platform as a whole might support names that a
specific filesystem can't handle, so this determination would need to
be per-filesystem.

Even then, one possible loophole in that restriction:

    $ cd /filesystem-that-can-handle-backslash-in-names/
    $ bzr checkout bzr://example.com/branch-foo/
    $ cd branch-foo/

    $ bzr add 'name\with\backslashes'
    $ bzr commit
    added name\with\backslashes
    Committed revision 101.

    $ bzr mv 'name\with\backslashes' 'normalname'
    $ bzr commit
    renamed name\with\backslashes => normalname
    Committed revision 102.


    $ cd /filesystem-that-CANNOT-handle-backslash-in-names/
    $ bzr checkout bzr://example.com/branch-foo/
    $ cd branch-foo/
    $ ls
    normalname

    $ bzr revert --revision 101

Should the checkout fail in the second case, even though the current
working tree is compatible with the filesystem? If so, any poor choice
of filename dooms the branch forever, beyond hope of a rename
operation. That doesn't seem reasonable.

Should the checkout succeed, but the revert fail if it creates a
working tree incompatible with the filesystem? I think that would be
better, but it's different from what you seem to be proposing.

-- 
 \       “If consumers even know there's a DRM, what it is, and how it |
  `\     works, we've already failed.” —Peter Lee, Disney corporation, |
_o__)                                                             2005 |
Ben Finney




More information about the bazaar mailing list