bzr resurrect vs. bzr revert

David Allouche david at allouche.net
Mon May 30 11:48:23 BST 2005


On Sun, 2005-05-29 at 00:26 -0400, Aaron Bentley wrote:
> David Allouche wrote:
> > "How do I restore a file that I removed by mistake" is moderately
> > frequent question. It would make the answer much simpler if the solution
> > was the same whether or not a commit occurred since the file was
> > deleted.
> 
> Yes.  We can just extend the 'revert' command so that you can specify
> particular files.  So:
> 
> bzr revert # revert all files to last commit
> bzr revert -r 50 # revert all files to their state at revision 50
> bzr revert -r 50 foo # revert 'foo' to its state at revision 50.
> 
> > But such a constraint may not be compatible with a non-surprising "undo"
> > command.
> 
> What do you think about that solution?

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.

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.

-- 
                                                            -- ddaa
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050530/39ac7d65/attachment.pgp 


More information about the bazaar mailing list