134
128
return ''.join(out)
137
def _load_from_file(topic_name):
138
"""Load help from a file.
140
Topics are expected to be txt files in bzrlib.help_topics.
142
resource_name = osutils.pathjoin("en", "%s.txt" % (topic_name,))
143
return osutils.resource_string('bzrlib.help_topics', resource_name)
146
131
def _help_on_revisionspec(name):
147
132
"""Generate the help for revision specs."""
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.
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
280
-Dauth Trace authentication sections used.
281
-Derror Instead of normal error handling, always print a traceback
283
-Devil Capture call sites that do expensive or badly-scaling
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
266
-Devil Capture call sites that do expensive or badly-scaling
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.
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.
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
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
================ =================================================================
573
547
log10 = log --short -r -10..-1
579
A criss-cross in the branch history can cause the default merge technique
580
to emit more conflicts than would normally be expected.
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.
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").
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.
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
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
607
_branches_out_of_sync = """Branches out of sync
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.
615
How you deal with this depends on *why* the branches are out of sync.
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").
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.
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')
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')
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',
677
586
topic_registry.register('repositories', _repositories,
678
587
'Basic information on shared repositories.',
680
topic_registry.register('rules', _load_from_file,
681
'Information on defining rule-based preferences',
683
589
topic_registry.register('standalone-trees', _standalone_trees,
684
590
'Information on what a standalone tree is',
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)
694
596
class HelpTopicIndex(object):