Search code examples
version-controlreleasebazaar

How can I remove history from a bzr branch, or create a branch for a tagged release that does not contain project history?


I would like to create a project branch that represents a stable release. I have followed the tag and export instructions described in the 'releasing a project' section of the bazaar manual, but this does not appear to create a new branch (i.e. there are no contents to the checkout).

My primary goals are to a) give developers the ability to submit changes to this branch while b) removing existing history.

Is there a way to do this in bazaar?


Solution

  • bzr tag defines a more descriptive identifier for a particular revision so that you can easily refer to that revision, e.g. when you are exporting a particular revision of your project for release.

    bzr export exports the contents of the working tree as it stands at the specified revision. The exported contents are not under revision control.

    If you want to create a branch from that tag, you can use bzr branch -rtag:TAGNAME original_branch new_branch but that does not remove existing history.

    You could use bzr export -rtag:TAGNAME /some/directory and then bzr init in /some/directory to create a new branch with no existing history, but starting with the contents of that particular revision.