Revert implmentation and how to undo a bzr remove
Benno
benjl at cse.unsw.edu.au
Wed Apr 27 10:21:29 BST 2005
On Mon Apr 11, 2005 at 11:30:50 +1000, Martin Pool wrote:
>On Sun, 2005-04-10 at 06:44 +1000, benjl at cse.unsw.edu.au wrote:
>> 2/ How to revert a remove:
>>
>> I've got no idea how to do this. It seems that you currently
>> can't:
>>
>> bzr_test% touch foo
>> bzr_test% bzr add foo
>> bzr_test% bzr commit -m "Added foo"
>> bzr_test% bzr status
>> bzr_test% bzr remove foo
>> bzr_test% bzr status
>> ? foo
>> D foo
>>
>> Any advice on how this should be implemented?
>
>It needs to put back the file-id that it previously had, by looking it
>up in the basis inventory. I think that's also what add should do, so
>that you can use it to cancel a remove operation that is not yet
>committed.
Right. The next question is how to get back the old id. And importantly
how to distinguish between the case:
$ bzr remove foo
$ bzr add foo
which should simply revert the "remove", and the case:
$ bzr remove foo
$ bzr commit -m "Removed foo"
$ rm foo
$ touch foo
$ bzr add foo
Where foo is a new file totally different to the orginal foo, so should
have a different UUID. Of course then there is the case of how to actually
revert the commit, as opposed to just reverting a working copy.
In any case, I'm not sure how to get access to the old UUID, expect by stashing
it into a file somewhere.
Cheers,
Benno
More information about the bazaar
mailing list