Is there a command to rollback a repository to particular revision?


#1

Git provides the checkout command, Mercurial has update both of these allow you to switch the repository’s working directory/tree to particular revision. Is there an equivalent in BitKeeper? I couldn’t glean which command might do this from the man pages.


#2

Both git and Mercurial support multiple branch tips in the current repository so that gives them an extra degree of freedom and makes it possible to move the checked out files independent of the the revision history.

In BitKeeper the checked out files always match the tip of the current revision history. This is part of why BitKeeper’s model is easier to learn and people are less likely to make mistakes with it. (Sorry for the marketing ;-))

So to rollback to a certain revision you have a couple options:

  • Discard the revision history in this repository:
    bk undo -a$REV
  • Create another repository at that point
    bk clone -r$REV . ../in-past
  • Look at certain files as of that point
    bk get -pr@$REV file | less
  • Extra all files as of that point
    bk export -tplain -r$REV . /tmp/snapshot

Often bk undo is fine because you can just pull back that history later.


#3

Thanks, I think as I’m cloning anyway just using the -r$REV option is probably the correct choice.