190
190
branch, which could be slow if a network connection is involved. Also, as you
191
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
193
Lightweight checkouts work best when you have fast reliable access to the
194
194
master branch. This means that if the master branch is on the same disk or LAN
195
195
a lightweight checkout will be faster than a heavyweight one for any commands
196
196
that modify the revision history (as only one copy branch needs to be updated).
199
199
then there wont be a noticeable difference.
201
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
202
containing your branches, where you maintain only one working tree by
203
203
switching the master branch that the checkout points to when you want to
204
204
work on a different branch.
206
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
207
branch. This means that the master branch must be accessible over a writeable
208
208
protocol , such as sftp://, and that you have write permissions at the other
209
209
end. Checkouts also work on the local file system, so that all that matters is
210
210
file permissions.
243
243
topic_registry.register('checkouts', _checkouts,
244
244
'Information on what a checkout is')
247
class HelpTopicIndex(object):
248
"""A index for bzr help that returns topics."""
253
def get_topics(self, topic):
254
"""Search for topic in the HelpTopicRegistry.
256
:param topic: A topic to search for. None is treated as 'basic'.
257
:return: A list which is either empty or contains a single
258
RegisteredTopic entry.
262
if topic in topic_registry:
263
return [RegisteredTopic(topic)]
268
class RegisteredTopic(object):
269
"""A help topic which has been registered in the HelpTopicRegistry.
271
These topics consist of nothing more than the name of the topic - all
272
data is retrieved on demand from the registry.
275
def __init__(self, topic):
278
:param topic: The name of the topic that this represents.
282
def get_help_text(self, additional_see_also=None):
283
"""Return a string with the help for this topic.
285
:param additional_see_also: Additional help topics to be
288
result = topic_registry.get_detail(self.topic)
289
# there is code duplicated here and in bzrlib/plugin.py's
290
# matching Topic code. This should probably be factored in
291
# to a helper function and a common base class.
292
if additional_see_also is not None:
293
see_also = sorted(set(additional_see_also))
297
result += '\nSee also: '
298
result += ', '.join(see_also)
302
def get_help_topic(self):
303
"""Return the help topic this can be found under."""