~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/help_topics.py

  • Committer: v.ladeuil+lp at free
  • Date: 2007-05-15 17:40:32 UTC
  • mto: (2485.8.44 bzr.connection.sharing)
  • mto: This revision was merged to the branch mainline in revision 2646.
  • Revision ID: v.ladeuil+lp@free.fr-20070515174032-qzdkangpv29l9e7g
Add a test that check that init connect only once. It fails.

* __init__.py:
(test_suite): Register the new test class.

* test_init.py: 
(InstrumentedTransport): A transport that can track connections.
(TransportHooks): Transport specific hooks.
(TestInit): Iniit command behavior tests.

* ftp.py:
(FtpTransport.__init__): Mark place that need fixing regarding
transport connection sharing

* builtins.py:
(cmd_init.run): Mark places that need fixing regarding transport
connection sharing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
193
193
--profile      Profile execution using the hotshot profiler
194
194
--lsprof       Profile execution using the lsprof profiler
195
195
--lsprof-file  Profile execution using the lsprof profiler, and write the
196
 
               results to a specified file.  If the filename ends with ".txt",
197
 
               text format will be used.  If the filename ends with
198
 
               ".callgrind", output will be formatted for use with KCacheGrind.
199
 
               Otherwise, the output will be a pickle.
200
 
 
201
 
See doc/developers/profiling.txt for more information on profiling.
 
196
               results to a specified file.
202
197
 
203
198
Note: --version must be supplied before any command.
204
199
"""
281
276
              commits are only made locally
282
277
"""
283
278
 
284
 
_repositories = \
285
 
"""Repositories
286
 
 
287
 
Repositories in Bazaar are where committed information is stored. There is
288
 
a repository associated with every branch.
289
 
 
290
 
Repositories are a form of database. Bzr will usually maintain this for
291
 
good performance automatically, but in some situations (e.g. when doing
292
 
very many commits in a short time period) you may want to ask bzr to 
293
 
optimise the database indices. This can be done by the 'bzr pack' command.
294
 
 
295
 
By default just running 'bzr init' will create a repository within the new
296
 
branch but it is possible to create a shared repository which allows multiple
297
 
branches to share their information in the same location. When a new branch is
298
 
created it will first look to see if there is a containing shared repository it
299
 
can use.
300
 
 
301
 
When two branches of the same project share a repository, there is
302
 
generally a large space saving. For some operations (e.g. branching
303
 
within the repository) this translates in to a large time saving.
304
 
 
305
 
To create a shared repository use the init-repository command (or the alias
306
 
init-repo). This command takes the location of the repository to create. This
307
 
means that 'bzr init-repository repo' will create a directory named 'repo',
308
 
which contains a shared repository. Any new branches that are created in this
309
 
directory will then use it for storage.
310
 
 
311
 
It is a good idea to create a repository whenever you might create more
312
 
than one branch of a project. This is true for both working areas where you
313
 
are doing the development, and any server areas that you use for hosting
314
 
projects. In the latter case, it is common to want branches without working
315
 
trees. Since the files in the branch will not be edited directly there is no
316
 
need to use up disk space for a working tree. To create a repository in which
317
 
the branches will not have working trees pass the '--no-trees' option to
318
 
'init-repository'.
319
 
 
320
 
Related commands:
321
 
 
322
 
  init-repository   Create a shared repository. Use --no-trees to create one
323
 
                    in which new branches won't get a working tree.
324
 
"""
325
 
 
326
 
 
327
 
_working_trees = \
328
 
"""Working Trees
329
 
 
330
 
A working tree is the contents of a branch placed on disk so that you can
331
 
see the files and edit them. The working tree is where you make changes to a
332
 
branch, and when you commit the current state of the working tree is the
333
 
snapshot that is recorded in the commit.
334
 
 
335
 
When you push a branch to a remote system, a working tree will not be
336
 
created. If one is already present the files will not be updated. The
337
 
branch information will be updated and the working tree will be marked
338
 
as out-of-date. Updating a working tree remotely is difficult, as there
339
 
may be uncommitted changes or the update may cause content conflicts that are
340
 
difficult to deal with remotely.
341
 
 
342
 
If you have a branch with no working tree you can use the 'checkout' command
343
 
to create a working tree. If you run 'bzr checkout .' from the branch it will
344
 
create the working tree. If the branch is updated remotely, you can update the
345
 
working tree by running 'bzr update' in that directory.
346
 
 
347
 
If you have a branch with a working tree that you do not want the 'remove-tree'
348
 
command will remove the tree if it is safe. This can be done to avoid the
349
 
warning about the remote working tree not being updated when pushing to the
350
 
branch. It can also be useful when working with a '--no-trees' repository
351
 
(see 'bzr help repositories').
352
 
 
353
 
If you want to have a working tree on a remote machine that you push to you
354
 
can either run 'bzr update' in the remote branch after each push, or use some
355
 
other method to update the tree during the push. There is an 'rspush' plugin
356
 
that will update the working tree using rsync as well as doing a push. There
357
 
is also a 'push-and-update' plugin that automates running 'bzr update' via SSH
358
 
after each push.
359
 
 
360
 
Useful commands:
361
 
 
362
 
  checkout     Create a working tree when a branch does not have one.
363
 
  remove-tree  Removes the working tree from a branch when it is safe to do so.
364
 
  update       When a working tree is out of sync with it's associated branch
365
 
               this will update the tree to match the branch.
366
 
"""
367
 
 
368
 
_status_flags = \
369
 
"""Status Flags
370
 
 
371
 
Status flags are used to summarise changes to the working tree in a concise
372
 
manner.  They are in the form:
373
 
   xxx   <filename>
374
 
where the columns' meanings are as follows.
375
 
 
376
 
Column 1: versioning / renames
377
 
  + File versioned
378
 
  - File unversioned
379
 
  R File renamed
380
 
  ? File unknown
381
 
  C File has conflicts
382
 
  P Entry for a pending merge (not a file)
383
 
 
384
 
Column 2: Contents
385
 
  N File created
386
 
  D File deleted
387
 
  K File kind changed
388
 
  M File modified
389
 
 
390
 
Column 3: Execute
391
 
  * The execute bit was changed
392
 
"""
393
 
 
394
279
 
395
280
topic_registry.register("revisionspec", _help_on_revisionspec,
396
281
                        "Explain how to use --revision")
406
291
                        'Information on what a checkout is')
407
292
topic_registry.register('urlspec', _help_on_transport,
408
293
                        "Supported transport protocols")
409
 
topic_registry.register('status-flags', _status_flags,
410
 
                        "Help on status flags")
411
294
def get_bugs_topic(topic):
412
295
    from bzrlib import bugtracker
413
296
    return bugtracker.tracker_registry.help_topic(topic)
414
297
topic_registry.register('bugs', get_bugs_topic, 'Bug tracker support')
415
 
topic_registry.register('repositories', _repositories,
416
 
                        'Basic information on shared repositories.')
417
 
topic_registry.register('working-trees', _working_trees,
418
 
                        'Information on working trees')
419
298
 
420
299
 
421
300
class HelpTopicIndex(object):
476
355
    def get_help_topic(self):
477
356
        """Return the help topic this can be found under."""
478
357
        return self.topic
479