Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Go back to old revision in Bazaar

I want to go back in my bazaar history (change working tree) to find the commit that introduced a certain bug.

I do not want to delete any commits, just change my working tree until I found the bug, and then I want to go back to the latest revision to work on.

What are the two commands for that (going back to an earlier commit and afterwards checking out the latest revision again)?

Thanks in advance.

like image 904
knub Avatar asked Mar 13 '12 13:03

knub


2 Answers

To revert the working tree back to a specific revision N:

bzr revert -rN 

To revert the working tree to the latest revision in the branch:

bzr revert 
like image 88
jelmer Avatar answered Oct 20 '22 18:10

jelmer


There are two ways to take your working tree back in time to revision N. The first has been mentioned by other answers here:

bzr revert -rN 

That will modify all the files necessary to make your working tree match the contents of revision N. If you run bzr status it will show all those files as changed. If you run bzr commit then all those backward changes would get committed and your HEAD revision would now look like revision N.

To come back to the latest version in your branch:

bzr revert 

You could also run bzr update, but that might get some newer revisions if your branch is a checkout.

The other option for going back in time is this:

bzr update -rN 

The difference between the two is that bzr update makes it look as though no changes have been made. It's just that your working tree is out of date.

To come back to the latest version in your branch:

bzr update 
like image 37
Don Kirkby Avatar answered Oct 20 '22 18:10

Don Kirkby