[RFC] case sensitivity on Windows

Mark Hammond mhammond at skippinet.com.au
Tue Nov 4 01:35:20 GMT 2008


> So at present you have a method which, given a name in arbitrary case,
> tells you what case it actually has on disk.  It seems like we also
> need a method which, given a name in arbitrary case, looks up that
> name in the tree.  I don't think this exists yet, and it probably has
> to, because the inventory and tree code at present is case sensitive.
> We can't just use the first because in general the case present on
> disk is not the same as what's used in memory.
> 
> I can think of a few ways to tackle this: one is to have the
> inventory/tree code have a 'mode' (conceptually a bit on the object;
> possibly actually composition with a different object) that tells it
> to do everything case-insensitively.

I've started looking into this and I'm a little lost :(  As a first step, I
thought a version of path2id which ignores the case of the path would work,
which you could then pass back to id2path to get the 'canonical' name in the
inventory.  I've a couple of problems with this approach:

* Adding this method to tree.py is easy - but its not clear that will
actually be used.

* Adding this method to workingtree_4 is a little tricker - it probably
means we need to add that capability to diststate._get_entry() - but that
method is hairy!

* As you imply above, this may not be enough: we probably need almost *all*
of the path matching methods on the tree to ignore the case on such
file-systems (ie, the "mode" you describe), so, eg, 'bzr status' will ignore
the case of the file on the file-system and just match the inventory.  But
this is harier still!!

Any advice for how this could best be implemented?  Would it help if I
published my branch under the bzr project on launchpad so others could help
with the hacking?

Thanks,

Mark.




More information about the bazaar mailing list