bzr assumes I want to remove the file if I delete it from the filesystem

Michael Ellerman michael at ellerman.id.au
Fri Dec 9 17:21:50 GMT 2005


On Fri, 9 Dec 2005 10:05, Bjorn Tillenius wrote:
> On Fri, Dec 09, 2005 at 04:26:54PM +0100, Mark Rosenstand wrote:
> > Bjorn Tillenius wrote:
> > > Hi,
> > >
> > > I got surprised about how bzr worked, and I'm not sure it's a bug or
> > > not, I would say that it is, though.
> > >
> > > If foo is a versioned filed, and I do 'rm foo; bzr commit'. Should bzr
> > > really remove the file from the repository then? It seems quite odd to
> > > me, especially since I temporarily removed a file from the file
> > > system, and forgot to 'bzr revert' it before I committed... What's
> > > the best way of restoring the file with all its history retained?
> >
> > IIRC it doesn't matter if you commit or not, if you rm a file you can't
> > get it back easily. We had a talk about it in #bzr a while back. I
> > think we came to the conclusion that it was a bug, but I don't know if
> > it has been fixed since 0.6.
>
> It seems to have been fixed. If you haven't committed yet, you can
> revert a deleted file. And even if you have committed, you can, as I
> was told, uncommit, and then revert it to get it back.

You can also revert the file to the state it was before you deleted it, eg:

$ echo "hello" > test
$ bzr add test
added test
$ bzr ci -m "add test"
Committed revision 1.
$ rm test
$ bzr ci -m "oops, removed test"
Committed revision 2.
$ cat test
cat: test: No such file or directory
$ bzr revert -r 1 test
$ cat test
hello
$ bzr st
added:
  test

cheers

-- 
Michael Ellerman
IBM OzLabs

email: michael:ellerman.id.au
inmsg: mpe:jabber.org
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051209/c83b57f7/attachment.pgp 


More information about the bazaar mailing list