Bazaar as Subversion replacement

John Arbash Meinel john at arbash-meinel.com
Tue Jan 16 18:44:26 GMT 2007


Alexander Belchenko wrote:
> Aaron Bentley ?8H5B:
>> Nicholas Allen wrote:
>>> As you may remember I was evaluating Bazaar as a replacement for our
>>> existing Subversion repository a while ago. Bazaar's development model,
>>> features and ease of use would definitely be of benefit to us. However,
>>> there were a few issues that Bazaar does not currently handle as well as
>>> Subversion and which prevent us from migrating:
>>> 1 No line ending styles for text files (so Bazaar cannot really be used
>>> for multi platform development)
>> This is pretty complicated to do properly.
> 
>> A stopgap would be to have a precommit hook that fixed the line endings
>> whenever you committed.  Would that kind of solution be acceptable?
> 
> I think reading text files from disk with 'rU' mode is simple and fast
> solution. But checkout files from repository on disk require replacing
> of \n to needed line-endings variant.
> 

Well, you can write files in 'w' instead of 'wb' mode, which does that.

The problem is that it breaks all binary files. And breaks files that
*must* be in a particular line ending. (Visual Studio control files must
always be in CRLF form, or they complain that they are corrupted). PNG
files have an explicit \r\n in the header to force a corruption
detection if they are ever auto-translated.

It is better than CVS, because at least copying a CRLF file and checking
it in under Linux doesn't cause it to become CRCRLF on Windows.

But really, the only way to make it safe is to have a way to require the
user to explicitly enable it. You can make it friendly by letting the
user set some patterns for default selection (by default *.png files are
considered binary, by default *.c files are considered text).

But there are quite a few extensions that get double duty. The most
common is '*.doc'. Where you obviously have MS Word documents, but I've
also seen a lot of text documentation use .doc. '*.dat' is another one
that gets used to mean all sorts of things. '.pdb' has multiple
definitions, but AFAIK they are all binary, so it doesn't really matter.

Anyway, I have a very strong feeling that any simple solution is going
to break badly under a lot of circumstances.

John
=:->




More information about the bazaar mailing list