Using bazaar over email

John Arbash Meinel john at arbash-meinel.com
Wed May 14 22:31:04 BST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Suraj Barkale wrote:
| Hi,
|     I want to use bazaar for syncing files over email with a remote site (most
| of them are binary files). Initially, I am going to create a repository on my
| PC, branch it locally (lets call this L) and send zipped branch folder over
| email to the remote site (lets call this R).
|     I will check in my modifications in L, create a patch file with repository
| as the target and send the patch using email to be merged in R.
|     As there is no public branch on the remote site, I don't know how to get
| back changes from R. Is there a way of doing this (i.e. sending bundles without
| public branch)?
|     Is there a better method of doing this using bazaar?
| Thanks & Regards,
| Suraj
|
|
|

I assume both sides have bzr, or you wouldn't be able to apply the patch on the
other side.  For clarity, I will call them host_a (the local host), and host_b,
the remote host.

So I would do something like:


1  bzr init-repo project
2  bzr init host_b
3  bzr init local
4  cd local
5  bzr add; bzr commit; etc, etc

step 1 gives a local shared repository, that will be able to share storage space
between the 2 branches.

step 2 initializes what you will consider a "mirror" of the remote host, right
now it is empty, because you haven't sent anything to the remote host yet.

step 3 starts your local branch, and 4&5 populate it with data, that you will
want to send to the other location.

When you are ready to send the data to the other location, you can run:

~  bzr send ../other_host

Which should start your email client, or you can use -o filename_host_a.patch to
send it to a file, and start your mail client yourself.

On the remote host you will do something like:

1  bzr init-repo project
2  bzr init host_a
3  bzr init local
4  cd incoming
5  bzr pull ../filename.patch
6  cd ../local
7  bzr merge ../incoming && bzr commit  OR   bzr pull ../incoming

The idea is that on both sides, you keep a branch on disk that mirrors the
branch on the other host.

When the remote host makes changes, they simply do the same:

cd local
bzr send ../host_a -o filename_host_b.patch

On host_a you do

cd host_b
bzr pull ../filename_host_b.patch
cd ../local
bzr merge ../host_b


The host_a and host_b branches just act as pointers that each side uses to
determine what revisions are present on the other side. Then 'bzr send' can
figure out what other revisions need to be transmitted.

The 'bzr pull ../foo.patch' just updates your pointer to the latest revisions
stored there.

This should always "work". Occasionally if you missed a 'pull' step, it will
transmit more revisions than you need to (the .patch file will be bigger than it
has to be).

Does this make sense?

Ian- this sort of thing sounds like a great example chapter in the user guide.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkgrWhgACgkQJdeBCYSNAAMalQCgpiLGcVc83pMTDttnqpNK56xs
EzMAoL1p4YmZnRuUi9gCzzx8iSQv44AU
=exUi
-----END PGP SIGNATURE-----



More information about the bazaar mailing list