How to synchronize with a branch "physically isolated"?

Asked by Vincent Begaut

Hi,

By "physically isolated", I mean that the 2 branches are on different machines with no network connection between them.
Therefore, commands like "push/pull/merge" cannot reach the remote branch.

Bazaar documentation page "Giving back" (http://bazaar-vcs.org/BzrGivingBack) refers to the 'bundle' command, which appears to be what I need.
However, this command is not documented in the latest user reference documentation (http://doc.bazaar-vcs.org/latest/en/user-reference/bzr_man.html).
Therefore, I do not know how to manipulate bundle files, and if this could solve my problem.

Also:
- is this intentional to have no reference of 'bundle' command in the documentation?
- are there any other good practices that could solve my case?

Thanks for your help,
Vincent.

Question information

Language:
English Edit question
Status:
Solved
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Solved by:
John A Meinel
Solved:
Last query:
Last reply:
Revision history for this message
Best John A Meinel (jameinel) said :
#1

The 'bzr bundle' command has migrated into the 'bzr send' command. (bzr bundle still exists, but send is the preferred interface.)

In general, you would want to have at least an approximate mirror of the other branch so that you have a good idea of what revisions they have.

I would set it up thusly:

MACHINE A:
# Create a space to store revisions so that they can be shared between branches
% bzr init-repo --trees project
# Create a branch which will track the other machines version
% bzr init machine_b
# And create your own local copy
% bzr branch machine_b local

# Now hack in 'local' commit, etc.
% cd local; bzr commit -m "stuff I did"

# send this stuff to the other machine
% bzr send -o mychanges-01.patch
# send can --mail-to using your email client if you want, or you can copy the .patch to a floppy disk/usb disk, etc.

# Now that you've sent the changes to machine_b, update your local 'mirror' to indicate that. Note that you may want to wait for a
# response from them first.

MACHINE B:
# same setup steps
% bzr init-repo --trees project
% cd project
% bzr init machine_a
% bzr branch machine_a local

# Only now, lets get 'machine_a' to point at the tip we just received
% cd machine_a
% bzr pull ../mychanges-01.patch
# 'machine_a' is now an exact copy of the tip at the time the bundle was made.
# Decide how you want to handle that in the local branch
% cd ../local
% bzr merge ../machine_a
<review, fix merge conflicts, etc>
% bzr commit -m "Merging changes from machine_a"
# Do some work here, commit it, and send it to machine_a
% bzr commit -m "did some of my own work"
% bzr send -o ../machine_b_changes-01.patch

MACHINE A
% cd machine_b
% bzr pull --overwrite ../machine_b_changes-01.patch
# Now you have an exact copy of the remote branch, do what you want.

It is possible to do this without maintaining a separate 'mirror' on each side. But it is a bit more difficult, and this is pretty straightforward. Also, if you did "bzr branch machine_X local" then the default submit branch for "bzr send" is that branch. Otherwise you need to supply "bzr send ../machine_X -o ". You can use --remember so you don't have to write it every time.

Revision history for this message
Martin Pool (mbp) said :
#2

If you're going to use a usb stick to move data between the two machines, another option is just to mount it on one machine, push the branch onto it, then mount it on the other and pull or merge from there.

Revision history for this message
Vincent Begaut (dr-virago) said :
#3

Machine_A would be my development server and Machine_B my production one.
Being able to use Bazaar on the production side will ease the management of hot (dirty) fixes and the release of new code.

Thanks for the explanation, the scenario presented by John summarizes exactly my case!

Revision history for this message
Vincent Begaut (dr-virago) said :
#4

Thanks John A Meinel, that solved my question.