tags:

views:

141

answers:

2

I'm trying to backup my shared bzr repository. I have looked at bzr export hotcopy.tgz but it seems only to take a snapshot of the latest revision.

Is there a command for doing backups, or do I have to

  1. full checkout into a tmp dir
  2. compress the tmp dir
  3. remove the tmp dir

Or is there a better way to backup a bzr repository?

+1  A: 

No, there is no other ways.

bialix
+1  A: 

You could try something like this:

mkdir /tmp/emptyrepos && bzr init /tmp/emptyrepos && bzr send -r 1..last:1 -o - /tmp/emptyrepos | gzip > mybackup.bzr.gz

That will create a bazaar native format merge-directive which you could apply to an empty repository to re-create all state.

Alternatively, it's likely safe to just tar up the current checkout. The on-disk format should be designed to safely deal with partial updates you may grab with tar.

Steven Schlansker
When running this command, I'm experiencing this: ERROR: Not a branch: "/private/tmp/".I'm on Mac OS X. The I have tried inserting /private/tmp, but it gives same error. I'm new to bazaar so I don't quite understand the error message yet.
neoneye
The basic idea is to create an empty branch to diff against - you can make an empty directory somewhere and run bzr init within it; I just used something in /tmp/ because it's a good place to put temporary stuff. That said, are you sure you didn't mistype it?
Steven Schlansker
Here is the terminal output http://pastebin.im/1408 Thank you very much, but I think I go for the checkout temporary repository instead of using send, since it seems more simple.
neoneye