bzr resurrect vs. bzr revert
Aaron Bentley
aaron.bentley at utoronto.ca
Mon May 30 12:51:11 BST 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
David Allouche wrote:
> On Sun, 2005-05-29 at 00:26 -0400, Aaron Bentley wrote:
>>Yes. We can just extend the 'revert' command so that you can specify
>>particular files. So:
>>bzr revert -r 50 foo # revert 'foo' to its state at revision 50.
> Consider how that affect the reply to "How do I restore a file that I
> removed by mistake".
>
> That would be:
> If you have not committed since you deleted the file, do "bzr
> revert foo". If you have committed, find the latest revision N
> that contains the file you want back and do "bzr revert -r N
> foo".
>
> Compare to:
> Just do "bzr resurrect foo". It will restore the latest file
> that had that name.
Or the answer could always be "Whatever mistake you made, bzr revert foo
- -r REV FILE will restore the file to a good state-- you just need to
specify the revision when the file was in good shape."
Instead of
"Aaah! I screwed up a file!"
"Did you modify it incorrectly, or did you delete it"
"I deleted it."
"Well, if you deleted it, use resurrect. If you introduced a bad
change, use revert."
So in fact, you now have three answers. resurrect for deletions, revert
to return files to their last-committed state, and revert -r to return
files to some other committed state.
> BTW, in both cases it should be an error to try to resurrect a file that
> still exists (with the same file id) by another name.
>
> My point is that "find the latest file that had that name" is irregular
> compared to the semantics of "reverse", so it should probably be a a
> different command.
I guess if you figure it's an important enough case, it makes sense to
have a separate command.
Personally, I don't recall ever deleting a file, committing, and then
wanting that file back. If that's the common case, having one command
is better.
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCmv4v0F+nu1YWqI0RAh1tAJ9G8XOENI1MEBwk8dE830wVyTLf2wCghUTk
Lybk+9IvFica2d8AvFm22Q0=
=eQVl
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list