Here's a quick bash script I knocked together to automatically create a zip of the files contained in a Bazaar branch. It takes two parameters - the location of the branch (local, sftp or http) and the name of the zip file to create (minus the .zip extension).
#! /bin/bashecho -e "\nbzr2zip - checks out Bazaar repository and creates zip of files (requires Bazaar)\n"if [ $# -eq 2 ]; thenbzr co $1 $2if [ $? -eq 0 ]; thenrm -fr $2/.bzrzip -rm $2 $2echo -e "\nCreated: $2.zip\n"fielseecho "Usage: ./bzr2zip branch-url zip-filename"fi
Download a plain text version of the script.
You can try it out on one of the branches in my public repository.
My bash scripting skills aren't up to much so let me know if there's a better way to write anything contained in the script or think it's missing functionality that should be there.
You could potentially remove the second rm line by adding the switch "m" to the zip command. This moves the files into the zip.
Thus you will have:
Thanks Stuart - script updated accordingly.
Even better I've just discovered 'bzr export' which can export a branch to pretty much any archive format. For more info see 'bzr help export'