151
151
Note: --version must be supplied before any command.
157
Checkouts are source trees that are connected to a branch, so that when
158
you commit in the source tree, the commit goes into that branch. They
159
allow you to use a simpler, more centralized workflow, ignoring some of
160
Bazaar's decentralized features until you want them. Using checkouts
161
with shared repositories is very similar to working with SVN or CVS, but
162
doesn't have the same restrictions. And using checkouts still allows
163
others working on the project to use whatever workflow they like.
165
A checkout is created with the bzr checkout command (see "help checkout").
166
You pass it a reference to another branch, and it will create a local copy
167
for you that still contains a reference to the branch you created the
168
checkout from (the master branch). Then if you make any commits they will be
169
made on the other branch first. This creates an instant mirror of your work, or
170
facilitates lockstep development, where each developer is working together,
171
continuously integrating the changes of others.
173
However the checkout is still a first class branch in Bazaar terms, so that
174
you have the full history locally. As you have a first class branch you can
175
also commit locally if you want, for instance due to the temporary loss af a
176
network connection. Use the --local option to commit to do this. All the local
177
commits will then be made on the master branch the next time you do a non-local
180
If you are using a checkout from a shared branch you will periodically want to
181
pull in all the changes made by others. This is done using the "update"
182
command. The changes need to be applied before any non-local commit, but
183
Bazaar will tell you if there are any changes and suggest that you use this
186
It is also possible to create a "lightweight" checkout by passing the
187
--lightweight flag to checkout. A lightweight checkout is even closer to an
188
SVN checkout in that it is not a first class branch, it mainly consists of the
189
working tree. This means that any history operations must query the master
190
branch, which could be slow if a network connection is involved. Also, as you
191
don't have a local branch, then you cannot commit locally.
193
Lightwieght checkouts work best when you have fast reliable access to the
194
master branch. This means that if the master branch is on the same disk or LAN
195
a lightweight checkout will be faster than a heavyweight one for any commands
196
that modify the revision history (as only one copy branch needs to be updated).
197
Heavyweight checkouts will generally be faster for any command that uses the
198
history but does not change it, but if the master branch is on the same disk
199
then there wont be a noticeable difference.
201
Another possible use for a checkout is to use it with a treeless repository
202
containing your branches, where you maintain only only one working tree by
203
switching the master branch that the checkout points to when you want to
204
work on a different branch.
206
Obviously to commit on a checkout you need to be able to write to the master
207
branch. This means that the master branch must be accessable over a writeable
208
protocol , such as sftp://, and that you have write permissions at the other
209
end. Checkouts also work on the local file system, so that all that matters is
212
You can change the master of a checkout by using the "bind" command (see "help
213
bind"). This will change the location that the commits are sent to. The bind
214
command can also be used to turn a branch into a heavy checkout. If you
215
would like to convert your heavy checkout into a normal branch so that every
216
commit is local, you can use the "unbind" command.
220
checkout Create a checkout. Pass --lightweight to get a lightweight
222
update Pull any changes in the master branch in to your checkout
223
commit Make a commit that is sent to the master branch. If you have
224
a heavy checkout then the --local option will commit to the
225
checkout without sending the commit to the master
226
bind Change the master branch that the commits in the checkout will
228
unbind Turn a heavy checkout into a standalone branch so that any
229
commits are only made locally
155
233
topic_registry.register("revisionspec", _help_on_revisionspec,
156
234
"Explain how to use --revision")