[BUG] Re: Adding and reverting a file deletes the file
John A Meinel
john at arbash-meinel.com
Fri Oct 7 03:24:09 BST 2005
Michael Ellerman wrote:
> On Fri, 7 Oct 2005 11:24, Aaron Bentley wrote:
...
>
> I disagree, revert is being over zealous. At the time of the commit bzr knows
> nothing about the existence or non-existence of the file "text". "revert" is
> making the assumption that because bzr didn't know of the file at the time of
> the commit, the file didn't exist. That is wrong.
>
> I agree that we don't have enough information to do the right thing. But we
> have two options. At the time of the commit the file either existed, or
> didn't exist - revert can chose one of those options. Currently it guesses
> that the file didn't exist, I think that's the wrong choice because it's
> lossy.
>
>
>>But when we want to add a file that's not there, it's pretty clear that
>>we've got to create it. It's less clear what to do when we remove a
>>file. But if we always removed, never deleted, then merge would be a
>>vector for installing unversioned files.
>
>
> I think you're referring to foo.(THIS|OTHER|BASE) ? Isn't that just a
> "feature" of the merge code?
>
I think you are missing the fact that "bzr revert" is just
bzr merge -r <working dir>..<last commit>
So apply the merge that results from changing the working directory into
the last commit.
We could supply the merge code with an extra flag which says "don't
delete removed files", which is only set when merge is called by revert.
But I think these are also solutions:
A) Having revert create the FILE~ when it deletes
B) Creating the changeset that we have talked about
C) Robert's suggestion that merge would see if the file has ever
existed, in which case it is a genuine delete.
John
=:->
> cheers
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 253 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051006/c8f8030a/attachment.pgp
More information about the bazaar
mailing list