~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/help_topics.py

  • Committer: Vincent Ladeuil
  • Date: 2007-11-04 15:24:27 UTC
  • mto: (2961.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 2962.
  • Revision ID: v.ladeuil+lp@free.fr-20071104152427-p9k7e4toywa87wfc
Review feedback.

* doc/en/user-guide/authentication_conf.txt: 
New file. Authentication configuration file documentation.

* doc/en/user-guide/configuration.txt: 
Slight modifications, add authentication.conf reference.

* doc/en/mini-tutorial/index.txt: 
Fix make docs warning.

* doc/developers/authentication-ring.txt: 
Small cleanups noticed during
doc/en/user-guide/authentication_conf.txt redaction.

* bzrlib/transport/http/_urllib.py:
(HttpTransport_urllib._perform): Use a dict() instead of {} syntax.

* bzrlib/tests/blackbox/test_whoami.py:
(TestWhoami.test_whoami_branch): Delete BZREMAIL related tests.

* bzrlib/config.py:
(Config.username): BZREMAIL deleted, has been obsolete for more
than a year.
(AuthenticationConfig.__init__): Review feedback, since keeping a
callback as an attribute is useless, call it now and keep the
filename itself as an attribute.
(AuthenticationConfig.get_credentials): Use a dict() instead of {}
syntax.

* NEWS: 
Updated as per Martin's suggestion.

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
-Dauth         Trace authentication sections used.
 
265
-Derror        Instead of normal error handling, always print a traceback on
 
266
               error.
 
267
-Devil         Capture call sites that do expensive or badly-scaling
 
268
               operations.
 
269
-Dhashcache    Log every time a working file is read to determine its hash.
 
270
-Dhooks        Trace hook execution.
 
271
-Dhpss         Trace smart protocol requests and responses.
 
272
-Dindex        Trace major index operations.
 
273
-Dlock         Trace when lockdir locks are taken or released.
295
274
"""
296
275
 
297
276
_standard_options = \
349
328
Lightweight checkouts work best when you have fast reliable access to the
350
329
master branch. This means that if the master branch is on the same disk or LAN
351
330
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.
 
331
that modify the revision history (as only one copy branch needs to be updated).
 
332
Heavyweight checkouts will generally be faster for any command that uses the
 
333
history but does not change it, but if the master branch is on the same disk
 
334
then there wont be a noticeable difference.
356
335
 
357
336
Another possible use for a checkout is to use it with a treeless repository
358
337
containing your branches, where you maintain only one working tree by
480
459
 
481
460
Related commands::
482
461
 
483
 
  init    Change a directory into a versioned branch.
 
462
  init    Make a directory into a versioned branch.
484
463
  branch  Create a new copy of a branch.
485
464
  merge   Perform a three-way merge.
486
465
"""
544
523
BZR_PLUGIN_PATH  Paths where bzr should look for plugins.
545
524
BZR_HOME         Directory holding .bazaar config dir. Overrides HOME.
546
525
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
526
================ =================================================================
552
527
"""
553
528
 
573
548
  log10 = log --short -r -10..-1
574
549
"""
575
550
 
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
551
 
628
552
# Register help topics
629
553
topic_registry.register("revisionspec", _help_on_revisionspec,
644
568
                        "Help on status flags")
645
569
def get_bugs_topic(topic):
646
570
    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')
 
571
    return "Bug Trackers\n\n" + bugtracker.tracker_registry.help_topic(topic)
 
572
topic_registry.register('bugs', get_bugs_topic, 'Bug tracker support')
650
573
topic_registry.register('env-variables', _env_variables,
651
574
                        'Environment variable names and values')
652
575
topic_registry.register('files', _files,
653
576
                        'Information on configuration and log files')
654
577
 
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
578
 
666
579
# Register concept topics.
667
580
# Note that we might choose to remove these from the online help in the
671
584
                        'Information on what a branch is', SECT_CONCEPT)
672
585
topic_registry.register('checkouts', _checkouts,
673
586
                        '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
587
topic_registry.register('repositories', _repositories,
678
588
                        'Basic information on shared repositories.',
679
589
                        SECT_CONCEPT)
680
 
topic_registry.register('rules', _load_from_file,
681
 
                        'Information on defining rule-based preferences',
682
 
                        SECT_CONCEPT)
683
590
topic_registry.register('standalone-trees', _standalone_trees,
684
591
                        'Information on what a standalone tree is',
685
592
                        SECT_CONCEPT)
686
593
topic_registry.register('working-trees', _working_trees,
687
594
                        '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
595
 
693
596
 
694
597
class HelpTopicIndex(object):