Case Insensitive File-systems and Bazaar

There's an issue with Bazaar caused by case-insensitive file systems (technically case preserving). When you add a file/directory called "foo" when "Foo" is already versioned, Bazaar will do exactly as it's told and while start to version Foo. Now the problems start because to a case-insensitive file-system, "Foo" and "foo" point to the same location.

When others update the branch all kinds of horrific errors will occur as bazaar will try to update both the files/directories that it has registered internally but as they resolve to one location the whole thing get's in a real mess.

The kind of error that you might see could be something like: bzr: ERROR: [Errno 66] Directory not empty

There's a couple of ways to resolve this problem if it was caused by the last commit. Simply run bzr uncommit.

Alternatively you can checkout the branch with the issue to a case-sensitive filesystem. On a mac this is possible by creating a disk image with Disk utility and then re-formatting to HFS+ with case-sensitivity switched on. Still even if you remove these files from the branch here and commit them you will still need to get other users to remove the files on their local system as an update will still try to remove both files/directories and get tied up again :-)

The Future Solution

The good news is that there's a blueprint in place for this problem to be addressed (see http://bazaar-vcs.org/CaseInsensitiveWorkingTreeSupport for more info). Naturally to me it seems that a case-insensitivity filesystem compatibility mode (CIF) should be on by default. This is particularly necessary if you take into account something like launchpad.net where you want anyone in the community to be able to checkout a branch. Naturally this will occur across all kinds of operating systems and filesystems so CIF will be required to prevent duplicate files to get versioned.

Just as a word of warning don't be tempted to install Mac OSX on partition formatted as case-sensitive HFS+. Apparently lots of applications have been built that rely on the case-insensitive default formatting and will break when running on a case-sensitive partition.