Conflicts due to independently creating identical files

Iain Murray transient.mail at gmail.com
Tue Nov 13 13:38:26 GMT 2007


Hi all,

I have a problem with conflicts when two copies of a project
independently obtain copies of the same file. I'll give a specific
example and then ask for some advice.

My usage: I have bzr-managed projects on a work machine and bound
branches on my laptop. I use the bzr+ssh:// transport.

Say I add a new file ("new_file") on my laptop and commit. Now, for my
own peculiar reasons, I give the server its own copy of "new_file"
with identical contents and properties. I then run an update on the
server:

% bzr update
+N  new_file
Conflict adding file new_file.  Moved existing file to new_file.moved.
1 conflicts encountered.
Updated to revision 1.

It's hard to believe this should be a conflict when both ends are in
complete agreement about "new_file". I appreciate the conflict is
because one end has a file ID for it and the other doesn't. But as a
user, it would be nice if this "Just Worked", for the same reasons as
in this related bug:
    https://bugs.launchpad.net/bzr/+bug/90569
Couldn't the end with the unversioned file just silently go to
versioning it with the same file ID as the other end?

I may be interested in trying to fix this, although would happily step
aside to someone that already knows the bzr code well. Some questions:
Is this a known/discussed issue? (I didn't find it, but the archives
are large.) Are there any subtle reasons why fixing this would be
hard?

Thanks,
Iain.

PS As a separate issue, this happens to me a lot for a reason I'm sure
I'm going to be told is stupid. I synchronize my laptop and work
machine home directories (except .bzr directories) with unison. I run
a separate hack to create and bind .bzr directories on each machine
whenever I start versioning a new project. Whenever I run unison it
looks as though someone came in and made a load of identical changes
on both machines. Normally update copes fine with this (an advertised
feature of bzr), unless the changes involved new files.

Probably I "shouldn't do that". But apart from this issue (which
actually I can hack around reasonably with another shell script), it
works well for me and does what I want. I'd like to choose when to
commit or otherwise fight with bzr, not be forced to on all my
projects just because I'm taking my laptop away from the network. With
unison I can sync all my files at once, whatever state they're in, and
whether they're in a versioned project or not. If anyone has a better
way of achieving this though, I'm open to suggestions.



More information about the bazaar mailing list