With TreeTransform bzr revert after uncommit causes conflicts with reverted files.

John A Meinel john at arbash-meinel.com
Tue Feb 21 23:09:13 GMT 2006


Aaron Bentley wrote:
> John A Meinel wrote:
>>> I haven't tracked down the exact cause yet, but I just had this happen:
>>> $ bzr revert
>>> bzr: WARNING: Conflict adding file rsync_update.py~.  Moved existing
>>> file to rsync_update.py~.moved.
>>>
>>>
>>> These are files which weren't modified in the mean time.
>>>
>>> I'm not sure what the specific problem is. It looks like the file was
>>> reverted 2 times, the first one creating a backup, and the second one
>>> causing it to create ~.moved.
> 
> You already had a rsync_update.py~, and then you created a new backup by
> reverting, which renamed the existing one.
> 
>>> I realize maybe the TreeTransform code is more 'correct', but it seems
>>> to me like it should be okay to overwrite the backup files.
> 
> The old merge code used to overwrite them, it's true.  I'm not sure if
> that jibes with keeping backup files in the first place.  Of course, I'd
> rather not keep backup files...
> 
> Aaron

Vim defaults to overwriting a backup file if it is present, depending on
your settings. (It can support the foo.~1~ foo.~2~ ... versioning).

I don't ever use the backup files. But to me a foo~ file is meant to
say, give me a single version safety net. So if I *just* did something
bad, I can fix it.
It isn't meant to be a 'I never want to lose anything' system.

Do other people have a feeling about this? I would like to see us not
create more and more backup files.

(Remember, this will cause problems if you keep reverting the same file.
You could pretty quickly get to the 10 maximum.

This is pretty ugly:
$ echo a >> a ; bzr revert

$ echo a >> a ; bzr revert
bzr: WARNING: Conflict adding file a~.  Moved existing file to a~.moved.

$ echo a >> a ; bzr revert
bzr: WARNING: Conflict adding file a~.  Moved existing file to a~.moved.
bzr: WARNING: Conflict adding file a~.moved.  Moved existing file to
a~.moved.moved.

$ echo a >> a ; bzr revert
bzr: WARNING: Conflict adding file a~.  Moved existing file to a~.moved.
bzr: WARNING: Conflict adding file a~.moved.  Moved existing file to
a~.moved.moved.
bzr: WARNING: Conflict adding file a~.moved.moved.  Moved existing file
to a~.moved.moved.moved.

$ echo a >> a ; bzr revert
bzr: WARNING: Conflict adding file a~.  Moved existing file to a~.moved.
bzr: WARNING: Conflict adding file a~.moved.  Moved existing file to
a~.moved.moved.
bzr: WARNING: Conflict adding file a~.moved.moved.  Moved existing file
to a~.moved.moved.moved.
bzr: WARNING: Conflict adding file a~.moved.moved.moved.  Moved existing
file to a~.moved.moved.moved.moved.

$ echo a >> a ; bzr revert
bzr: WARNING: Conflict adding file a~.  Moved existing file to a~.moved.
bzr: WARNING: Conflict adding file a~.moved.  Moved existing file to
a~.moved.moved.
bzr: WARNING: Conflict adding file a~.moved.moved.  Moved existing file
to a~.moved.moved.moved.
bzr: WARNING: Conflict adding file a~.moved.moved.moved.  Moved existing
file to a~.moved.moved.moved.moved.
bzr: WARNING: Conflict adding file a~.moved.moved.moved.moved.  Moved
existing file to a~.moved.moved.moved.moved.moved.

$ echo a >> a ; bzr revert
bzr: WARNING: Conflict adding file a~.  Moved existing file to a~.moved.
bzr: WARNING: Conflict adding file a~.moved.  Moved existing file to
a~.moved.moved.
bzr: WARNING: Conflict adding file a~.moved.moved.  Moved existing file
to a~.moved.moved.moved.
bzr: WARNING: Conflict adding file a~.moved.moved.moved.  Moved existing
file to a~.moved.moved.moved.moved.
bzr: WARNING: Conflict adding file a~.moved.moved.moved.moved.  Moved
existing file to a~.moved.moved.moved.moved.moved.
bzr: WARNING: Conflict adding file a~.moved.moved.moved.moved.moved.
Moved existing file to a~.moved.moved.moved.moved.moved.moved.

Obviously people wouldn't do it that way. But I think it is likely that
people will edit something, test it, revert it. fix it again, commit.
Then later on they will come back, modify it, revert it, get a
warning... etc.

Because the backup files don't go away. So over time you get a lot of
clutter.

So to me, overwriting foo~ is okay.

What is the use case for having the backup file? Just because 'bzr
revert' is a lossy command, and without backups you might accidentally
lose something you didn't want?

What if we create a config entry for this? Because I think both Aaron
and myself would like to disable it.

John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060221/f0186925/attachment.pgp 


More information about the bazaar mailing list