~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/help_topics.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-10-25 08:29:08 UTC
  • mfrom: (2940.1.2 ianc-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20071025082908-abn3kunrb2ivdvth
renaming of experimental pack formats to include knitpack in their name (Ian Clatworthy)

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
rendering on the screen naturally.
34
34
"""
35
35
 
36
 
import sys
37
 
 
38
 
import bzrlib
39
 
from bzrlib import (
40
 
    osutils,
41
 
    registry,
42
 
    )
 
36
from bzrlib import registry
43
37
 
44
38
 
45
39
# Section identifiers (map topics to the right place in the manual)
134
128
    return ''.join(out)
135
129
 
136
130
 
137
 
def _load_from_file(topic_name):
138
 
    """Load help from a file.
139
 
 
140
 
    Topics are expected to be txt files in bzrlib.help_topics.
141
 
    """
142
 
    resource_name = osutils.pathjoin("en", "%s.txt" % (topic_name,))
143
 
    return osutils.resource_string('bzrlib.help_topics', resource_name)
144
 
 
145
 
 
146
131
def _help_on_revisionspec(name):
147
132
    """Generate the help for revision specs."""
148
133
    import re
271
256
               "callgrind.out" or end with ".callgrind", the output will be
272
257
               formatted for use with KCacheGrind. Otherwise, the output
273
258
               will be a pickle.
274
 
--coverage     Generate line coverage report in the specified directory.
275
259
 
276
260
See doc/developers/profiling.txt for more information on profiling.
277
261
A number of debug flags are also available to assist troubleshooting and
278
262
development.
279
263
 
280
 
-Dauth            Trace authentication sections used.
281
 
-Derror           Instead of normal error handling, always print a traceback
282
 
                  on error.
283
 
-Devil            Capture call sites that do expensive or badly-scaling
284
 
                  operations.
285
 
-Dfetch           Trace history copying between repositories.
286
 
-Dhashcache       Log every time a working file is read to determine its hash.
287
 
-Dhooks           Trace hook execution.
288
 
-Dhpss            Trace smart protocol requests and responses.
289
 
-Dhttp            Trace http connections, requests and responses
290
 
-Dindex           Trace major index operations.
291
 
-Dknit            Trace knit operations.
292
 
-Dlock            Trace when lockdir locks are taken or released.
293
 
-Dmerge           Emit information for debugging merges.
294
 
-Dpack            Emit information about pack operations.
 
264
-Derror        Instead of normal error handling, always print a traceback on
 
265
               error.
 
266
-Devil         Capture call sites that do expensive or badly-scaling
 
267
               operations.
 
268
-Dhashcache    Log every time a working file is read to determine its hash.
 
269
-Dhooks        Trace hook execution.
 
270
-Dhpss         Trace smart protocol requests and responses.
 
271
-Dindex        Trace major index operations.
 
272
-Dlock         Trace when lockdir locks are taken or released.
295
273
"""
296
274
 
297
275
_standard_options = \
349
327
Lightweight checkouts work best when you have fast reliable access to the
350
328
master branch. This means that if the master branch is on the same disk or LAN
351
329
a lightweight checkout will be faster than a heavyweight one for any commands
352
 
that modify the revision history (as only one copy of the branch needs to
353
 
be updated). Heavyweight checkouts will generally be faster for any command
354
 
that uses the history but does not change it, but if the master branch is on
355
 
the same disk then there won't be a noticeable difference.
 
330
that modify the revision history (as only one copy branch needs to be updated).
 
331
Heavyweight checkouts will generally be faster for any command that uses the
 
332
history but does not change it, but if the master branch is on the same disk
 
333
then there wont be a noticeable difference.
356
334
 
357
335
Another possible use for a checkout is to use it with a treeless repository
358
336
containing your branches, where you maintain only one working tree by
480
458
 
481
459
Related commands::
482
460
 
483
 
  init    Change a directory into a versioned branch.
 
461
  init    Make a directory into a versioned branch.
484
462
  branch  Create a new copy of a branch.
485
463
  merge   Perform a three-way merge.
486
464
"""
544
522
BZR_PLUGIN_PATH  Paths where bzr should look for plugins.
545
523
BZR_HOME         Directory holding .bazaar config dir. Overrides HOME.
546
524
BZR_HOME (Win32) Directory holding bazaar config dir. Overrides APPDATA and HOME.
547
 
BZR_REMOTE_PATH  Full name of remote 'bzr' command (for bzr+ssh:// URLs).
548
 
BZR_SSH          SSH client: paramiko (default), openssh, ssh, plink.
549
 
BZR_LOG          Location of .bzr.log (use '/dev/null' to suppress log).
550
 
BZR_LOG (Win32)  Location of .bzr.log (use 'NUL' to suppress log).
551
525
================ =================================================================
552
526
"""
553
527
 
573
547
  log10 = log --short -r -10..-1
574
548
"""
575
549
 
576
 
_criss_cross = \
577
 
"""Criss-Cross
578
 
 
579
 
A criss-cross in the branch history can cause the default merge technique
580
 
to emit more conflicts than would normally be expected.
581
 
 
582
 
In complex merge cases, ``bzr merge --lca`` or ``bzr merge --weave`` may give
583
 
better results.  You may wish to ``bzr revert`` the working tree and merge
584
 
again.  Alternatively, use ``bzr remerge`` on particular conflicted files.
585
 
 
586
 
Criss-crosses occur in a branch's history if two branches merge the same thing
587
 
and then merge one another, or if two branches merge one another at the same
588
 
time.  They can be avoided by having each branch only merge from or into a
589
 
designated central branch (a "star topology").
590
 
 
591
 
Criss-crosses cause problems because of the way merge works.  Bazaar's default
592
 
merge is a three-way merger; in order to merge OTHER into THIS, it must
593
 
find a basis for comparison, BASE.  Using BASE, it can determine whether
594
 
differences between THIS and OTHER are due to one side adding lines, or
595
 
from another side removing lines.
596
 
 
597
 
Criss-crosses mean there is no good choice for a base.  Selecting the recent
598
 
merge points could cause one side's changes to be silently discarded.
599
 
Selecting older merge points (which Bazaar does) mean that extra conflicts
600
 
are emitted.
601
 
 
602
 
The ``weave`` merge type is not affected by this problem because it uses
603
 
line-origin detection instead of a basis revision to determine the cause of
604
 
differences.
605
 
"""
606
 
 
607
 
_branches_out_of_sync = """Branches out of sync
608
 
 
609
 
When reconfiguring a checkout, tree or branch into a lightweight checkout,
610
 
a local branch must be destroyed.  (For checkouts, this is the local branch
611
 
that serves primarily as a cache.)  If the branch-to-be-destroyed does not
612
 
have the same last revision as the new reference branch for the lightweight
613
 
checkout, data could be lost, so Bazaar refuses.
614
 
 
615
 
How you deal with this depends on *why* the branches are out of sync.
616
 
 
617
 
If you have a checkout and have done local commits, you can get back in sync
618
 
by running "bzr update" (and possibly "bzr commit").
619
 
 
620
 
If you have a branch and the remote branch is out-of-date, you can push
621
 
the local changes using "bzr push".  If the local branch is out of date, you
622
 
can do "bzr pull".  If both branches have had changes, you can merge, commit
623
 
and then push your changes.  If you decide that some of the changes aren't
624
 
useful, you can "push --overwrite" or "pull --overwrite" instead.
625
 
"""
626
 
 
627
550
 
628
551
# Register help topics
629
552
topic_registry.register("revisionspec", _help_on_revisionspec,
644
567
                        "Help on status flags")
645
568
def get_bugs_topic(topic):
646
569
    from bzrlib import bugtracker
647
 
    return ("Bug Tracker Settings\n\n" + 
648
 
        bugtracker.tracker_registry.help_topic(topic))
649
 
topic_registry.register('bugs', get_bugs_topic, 'Bug tracker settings')
 
570
    return "Bug Trackers\n\n" + bugtracker.tracker_registry.help_topic(topic)
 
571
topic_registry.register('bugs', get_bugs_topic, 'Bug tracker support')
650
572
topic_registry.register('env-variables', _env_variables,
651
573
                        'Environment variable names and values')
652
574
topic_registry.register('files', _files,
653
575
                        'Information on configuration and log files')
654
576
 
655
 
# Load some of the help topics from files
656
 
topic_registry.register('authentication', _load_from_file,
657
 
                        'Information on configuring authentication')
658
 
topic_registry.register('configuration', _load_from_file,
659
 
                        'Details on the configuration settings available')
660
 
topic_registry.register('conflicts', _load_from_file,
661
 
                        'Types of conflicts and what to do about them')
662
 
topic_registry.register('hooks', _load_from_file,
663
 
                        'Points at which custom processing can be added')
664
 
 
665
577
 
666
578
# Register concept topics.
667
579
# Note that we might choose to remove these from the online help in the
671
583
                        'Information on what a branch is', SECT_CONCEPT)
672
584
topic_registry.register('checkouts', _checkouts,
673
585
                        'Information on what a checkout is', SECT_CONCEPT)
674
 
topic_registry.register('patterns', _load_from_file,
675
 
                        'Information on the pattern syntax',
676
 
                        SECT_CONCEPT)
677
586
topic_registry.register('repositories', _repositories,
678
587
                        'Basic information on shared repositories.',
679
588
                        SECT_CONCEPT)
680
 
topic_registry.register('rules', _load_from_file,
681
 
                        'Information on defining rule-based preferences',
682
 
                        SECT_CONCEPT)
683
589
topic_registry.register('standalone-trees', _standalone_trees,
684
590
                        'Information on what a standalone tree is',
685
591
                        SECT_CONCEPT)
686
592
topic_registry.register('working-trees', _working_trees,
687
593
                        'Information on working trees', SECT_CONCEPT)
688
 
topic_registry.register('criss-cross', _criss_cross,
689
 
                        'Information on criss-cross merging', SECT_CONCEPT)
690
 
topic_registry.register('sync-for-reconfigure', _branches_out_of_sync,
691
 
                        'Information on criss-cross merging', SECT_CONCEPT)
692
594
 
693
595
 
694
596
class HelpTopicIndex(object):