[BUG] Re: Adding and reverting a file deletes the file
Aaron Bentley
aaron.bentley at utoronto.ca
Fri Oct 7 02:24:48 BST 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Michael Ellerman wrote:
> A little more clearly:
>
> concordia ~/test$ bzr init
> concordia ~/test$ echo "priceless data" > text
> concordia ~/test$ bzr commit -m unchanged --unchanged
> concordia ~/test$ bzr add text
> added text
> concordia ~/test$ bzr revert
> concordia ~/test$ cat text
> cat: text: No such file or directory
> concordia ~/test$
>
> That's a bug. At the time of the commit, "text" is unknown, so revert should
> restore it to that state - not delete it.
Unfortunately, it's not as clear-cut as that.
First, 'revert' is not 'undo'. It doesn't undo all operations since the
last commit, it restores the tree to the state it was in at the last
commit. It's successfully accomplishing that. Deleting potentially
valuable data, but restoring the state.
(bazaar undo has the same behavior)
We don't track creation or deletion of files, really. We only track
inventory adds and removes.
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.
Also, not all newly-added files should be preserved. If the files are
created because of a merge, I want them to disappear when I revert.
Unless I've edited them since.
So yeah, I agree with the spirit, but the bug is that we don't have a
good idea of how to address the issue.
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD4DBQFDRc5g0F+nu1YWqI0RApD3AJsFzTUpIk27OGaW3WHMflUipGgQcACXSUqG
jBNXRGlsCVd6XwKXdcXLWA==
=dE6H
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list