55
55
$ cd /srv/bzr/projectx
56
56
$ mv trunk trunk # can simply rename on the filesystem
57
$ bzr branch trunk texas-integration # very fast in a shared repository
57
$ brz branch trunk texas-integration # very fast in a shared repository
59
59
In Australia, we need to set up the ``/srv/bzr/projectx`` directory and get a
60
60
copy of the current trunk as australia-integration::
62
62
$ mkdir -p /srv/bzr
64
$ bzr init-shared-repo --no-trees projectx
64
$ brz init-shared-repo --no-trees projectx
66
$ bzr branch bzr+ssh://server.example.com/srv/bzr/trunk
67
$ bzr branch trunk australia-integration
66
$ brz branch bzr+ssh://server.example.com/srv/bzr/trunk
67
$ brz branch trunk australia-integration
79
79
# Get a copy of the Australia branch in Texas. After the initial branch
80
80
# command, use pull to keep the branch up to date. With a slow network,
81
81
# this is the only slow part
82
$ bzr branch bzr+ssh://autralia.example.com/srv/bzr/projectx/australia-integration \
82
$ brz branch bzr+ssh://autralia.example.com/srv/bzr/projectx/australia-integration \
83
83
bzr+ssh://server.example.com/srv/bzr/projectx/australia-integration
85
85
# Check out the master branch locally for doing the merge
87
$ bzr checkout bzr+ssh://server.example.com/srv/bzr/projectx/trunk
87
$ brz checkout bzr+ssh://server.example.com/srv/bzr/projectx/trunk
89
$ bzr merge bzr+ssh://server.example.com/srv/bzr/projectx/texas-integration
89
$ brz merge bzr+ssh://server.example.com/srv/bzr/projectx/texas-integration
90
90
# Run the test suite and resolve any conflicts
91
$ bzr commit -m "Merge Texas branch to master"
91
$ brz commit -m "Merge Texas branch to master"
93
93
# Now, merge from Australia using the local copy of that branch
94
$ bzr merge bzr+ssh://server.example.com/srv/bzr/projectx/australia-integration
94
$ brz merge bzr+ssh://server.example.com/srv/bzr/projectx/australia-integration
95
95
# Run the test suite and resolve any conflicts between the two offices
96
$ bzr commit -m "Merge Australia branch to master"
96
$ brz commit -m "Merge Australia branch to master"
98
98
Note that Bazaar does not commit even cleanly applied merges by default. This
99
99
is because although a merge may apply cleanly, the merged state still needs to
100
100
be checked before it is committed. (Just because there are no text conflicts
101
101
does not mean that everything will work after a merge.) An alternative that
102
102
can pull when possible and merge otherwise is available with
103
``bzr merge --pull``.
103
``brz merge --pull``.
105
105
Merging back to local trunks
106
106
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
108
108
Now the trunk branch is the most up-to-date version of the software and
109
109
both of the local trunks need to reincorporate the changes from the master.
110
110
If no new commits have been made to texas-integration, then that can happen using
114
$ bzr checkout bzr+ssh://server.example.com/srv/bzr/projectx/texas-integration
114
$ brz checkout bzr+ssh://server.example.com/srv/bzr/projectx/texas-integration
115
115
$ cd texas-integration
116
$ bzr pull ../trunk # Use trunk from the local disk
116
$ brz pull ../trunk # Use trunk from the local disk
117
117
# No need to commit
119
119
If new changes have happened on texas-integration since the integration with
120
120
trunk, then the above pull will produce an error suggesting to use
124
124
# Run test suite, resolve conflicts
125
$ bzr commit -m "Merging Australian changes"
125
$ brz commit -m "Merging Australian changes"
127
127
In Australia, they will need to update their local copy of trunk::
129
129
$ cd /srv/bzr/projectx/trunk
130
$ bzr pull # parent location is used by default
130
$ brz pull # parent location is used by default
132
132
Then, they need to pull or merge the changes from trunk into the local trunk.
133
133
This should be done by a developer with a checkout of australia-integration so
134
134
that they can run the test suite::
137
$ bzr co bzr+ssh://australia.example.com/srv/bzr/projectx/australia-integration
137
$ brz co bzr+ssh://australia.example.com/srv/bzr/projectx/australia-integration
138
138
$ cd australia-integration
139
$ bzr merge bzr+ssh://australia.example.com/srv/bzr/projectx/trunk
139
$ brz merge bzr+ssh://australia.example.com/srv/bzr/projectx/trunk
140
140
# Run test suite and integrate Texan changes with only recent local
142
$ bzr commit -m "Integrate work from Texas"
142
$ brz commit -m "Integrate work from Texas"
145
145
Other Considerations