Rev 4945: (igc) User Reference as topics in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Fri Jan 8 08:37:24 GMT 2010
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 4945 [merge]
revision-id: pqm at pqm.ubuntu.com-20100108083722-nkd6usr60lfpgwib
parent: pqm at pqm.ubuntu.com-20100108071807-vmk4kojiz0oqsyl5
parent: ian.clatworthy at canonical.com-20100108073725-04icssis1mvkncfc
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2010-01-08 08:37:22 +0000
message:
(igc) User Reference as topics
renamed:
bzrlib/help_topics/en/conflicts.txt => bzrlib/help_topics/en/conflict-types.txt conflicts.txt-20070723221841-ns3jvwxdb4okn6fk-1
modified:
Makefile Makefile-20050805140406-d96e3498bb61c5bb
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/bugtracker.py bugtracker.py-20070410073305-vu1vu1qosjurg8kb-1
bzrlib/bzrdir.py bzrdir.py-20060131065624-156dfea39c4387cb
bzrlib/commands.py bzr.py-20050309040720-d10f4714595cf8c3
bzrlib/conflicts.py conflicts.py-20051001061850-78ef952ba63d2b42
bzrlib/doc_generate/autodoc_rstx.py autodoc_rstx.py-20060420024836-3e0d4a526452193c
bzrlib/help_topics/__init__.py help_topics.py-20060920210027-rnim90q9e0bwxvy4-1
bzrlib/help_topics/en/authentication.txt authentication_conf.-20071104135035-glfv0ri355tyg1nf-1
bzrlib/help_topics/en/configuration.txt configuration.txt-20060314161707-868350809502af01
bzrlib/help_topics/en/content-filters.txt contentfilters.txt-20080516145112-7x1meuoci5w41isv-1
bzrlib/help_topics/en/log-formats.txt logformats.txt-20090209081655-5wpbws2oqz8k5oq7-1
bzrlib/help_topics/en/rules.txt rules.txt-20080516063844-ghr5l6pvvrhiycun-1
bzrlib/hooks.py hooks.py-20070325015548-ix4np2q0kd8452au-1
bzrlib/tests/test_bzrdir.py test_bzrdir.py-20060131065654-deba40eef51cf220
doc/en/user-guide/hooks.txt hooks.txt-20070829200551-7nr6e5a1io6x78uf-1
bzrlib/help_topics/en/conflict-types.txt conflicts.txt-20070723221841-ns3jvwxdb4okn6fk-1
=== modified file 'Makefile'
--- a/Makefile 2009-12-07 18:12:21 +0000
+++ b/Makefile 2010-01-07 06:44:05 +0000
@@ -199,7 +199,6 @@
# translate txt docs to html
derived_txt_files = \
- doc/en/user-reference/bzr_man.txt \
doc/en/release-notes/NEWS.txt
txt_all = \
doc/en/tutorials/tutorial.txt \
@@ -296,9 +295,6 @@
%.html: %.txt
$(rst2html) --stylesheet=../../default.css $< $@
-doc/en/user-reference/bzr_man.txt: $(MAN_DEPENDENCIES)
- $(PYTHON) tools/generate_docs.py -o $@ rstx
-
doc/en/release-notes/NEWS.txt: NEWS
$(PYTHON) -c "import shutil; shutil.copyfile('$<', '$@')"
=== modified file 'NEWS'
--- a/NEWS 2010-01-08 05:28:17 +0000
+++ b/NEWS 2010-01-08 07:37:25 +0000
@@ -99,7 +99,14 @@
* There is a System Administrator's Guide in ``doc/en/admin-guide``,
including discussions of installation, relevant plugins, security and
- backup.
+ backup. (Neil Martinsen-Burrell)
+
+* The ``conflicts`` help topic has been renamed to ``conflict-types``.
+ (Ian Clatworthy)
+
+* The User Reference is now presented as a series of topics.
+ Many of the included topics have link and format tweaks applied.
+ (Ian Clatworthy)
API Changes
***********
=== modified file 'bzrlib/bugtracker.py'
--- a/bzrlib/bugtracker.py 2010-01-04 08:17:28 +0000
+++ b/bzrlib/bugtracker.py 2010-01-08 07:37:25 +0000
@@ -39,12 +39,12 @@
_bugs_help = \
"""When making a commit, metadata about bugs fixed by that change can be
-recorded by using the --fixes option. For each bug marked as fixed, an
+recorded by using the ``--fixes`` option. For each bug marked as fixed, an
entry is included in the 'bugs' revision property stating '<url> <status>'.
(The only ``status`` value currently supported is ``fixed.``)
-The --fixes option allows you to specify a bug tracker and a bug identifier
-rather than a full URL. This looks like
+The ``--fixes`` option allows you to specify a bug tracker and a bug identifier
+rather than a full URL. This looks like::
bzr commit --fixes <tracker>:<id>
@@ -56,13 +56,13 @@
use this feature, you just need to know the tracker identifier to use.
These are the bugtrackers that are built in:
- ============================= ============= ================
- URL Abbreviation Example
- ============================= ============= ================
- https://bugs.launchpad.net/ lp lp:12345
- http://bugs.debian.org/ deb deb:12345
- http://bugzilla.gnome.org/ gnome gnome:12345
- ============================= ============= ================
+ ============================ ============ ============
+ URL Abbreviation Example
+ ============================ ============ ============
+ https://bugs.launchpad.net/ lp lp:12345
+ http://bugs.debian.org/ deb deb:12345
+ http://bugzilla.gnome.org/ gnome gnome:12345
+ ============================ ============ ============
For the bug trackers not listed above configuration is required.
Support for generating the URLs for any project using Bugzilla or Trac
@@ -85,11 +85,11 @@
Use ``bzr commit --fixes lp:2`` to record that this commit fixes bug 2.
-bugzilla_<tracker_abbreviation>_url
------------------------------------
+bugzilla_<tracker>_url
+----------------------
If present, the location of the Bugzilla bug tracker referred to by
-<tracker_abbreviation>. This option can then be used together with ``bzr commit
+<tracker>. This option can then be used together with ``bzr commit
--fixes`` to mark bugs in that tracker as being fixed by that commit. For
example::
@@ -98,11 +98,11 @@
would allow ``bzr commit --fixes squid:1234`` to mark Squid's bug 1234 as
fixed.
-trac_<tracker_abbrevation>_url
-------------------------------
+trac_<tracker>_url
+------------------
If present, the location of the Trac instance referred to by
-<tracker_abbreviation>. This option can then be used together with ``bzr commit
+<tracker>. This option can then be used together with ``bzr commit
--fixes`` to mark bugs in that tracker as being fixed by that commit. For
example::
@@ -111,11 +111,11 @@
would allow ``bzr commit --fixes twisted:1234`` to mark Twisted's bug 1234 as
fixed.
-bugtracker_<tracker_abbrevation>_url
-------------------------------------
+bugtracker_<tracker>_url
+------------------------
If present, the location of a generic bug tracker instance referred to by
-<tracker_abbreviation>. The location must contain an ``{id}`` placeholder,
+<tracker>. The location must contain an ``{id}`` placeholder,
which will be replaced by a specific bug ID. This option can then be used
together with ``bzr commit --fixes`` to mark bugs in that tracker as being
fixed by that commit. For example::
=== modified file 'bzrlib/bzrdir.py'
--- a/bzrlib/bzrdir.py 2010-01-06 04:53:40 +0000
+++ b/bzrlib/bzrdir.py 2010-01-08 07:37:25 +0000
@@ -3517,7 +3517,7 @@
experimental_pairs.append((key, help))
else:
output += wrapped(key, help, info)
- output += "\nSee ``bzr help formats`` for more about storage formats."
+ output += "\nSee :doc:`formats-help` for more about storage formats."
other_output = ""
if len(experimental_pairs) > 0:
other_output += "Experimental formats are shown below.\n\n"
@@ -3536,7 +3536,7 @@
other_output += \
"\nNo deprecated formats are available.\n\n"
other_output += \
- "\nSee ``bzr help formats`` for more about storage formats."
+ "\nSee :doc:`formats-help` for more about storage formats."
if topic == 'other-formats':
return other_output
=== modified file 'bzrlib/commands.py'
--- a/bzrlib/commands.py 2010-01-07 06:34:14 +0000
+++ b/bzrlib/commands.py 2010-01-08 07:37:25 +0000
@@ -511,8 +511,9 @@
# so don't create a real link
see_also_links.append(item)
else:
- # Use a reST link for this entry
- see_also_links.append("`%s`_" % (item,))
+ # Use a Sphinx link for this entry
+ link_text = ":doc:`%s <%s-help>`" % (item, item)
+ see_also_links.append(link_text)
see_also = see_also_links
result += ':See also: '
result += ', '.join(see_also) + '\n'
=== modified file 'bzrlib/conflicts.py'
--- a/bzrlib/conflicts.py 2009-12-10 17:03:48 +0000
+++ b/bzrlib/conflicts.py 2010-01-08 07:37:25 +0000
@@ -58,7 +58,7 @@
Option('text',
help='List paths of files with text conflicts.'),
]
- _see_also = ['resolve']
+ _see_also = ['resolve', 'conflict-types']
def run(self, text=False):
from bzrlib.workingtree import WorkingTree
=== modified file 'bzrlib/doc_generate/autodoc_rstx.py'
--- a/bzrlib/doc_generate/autodoc_rstx.py 2009-09-09 14:35:26 +0000
+++ b/bzrlib/doc_generate/autodoc_rstx.py 2010-01-08 07:34:31 +0000
@@ -14,7 +14,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-"""Generate ReStructuredText source for the User Reference Manual.
+"""Generate reStructuredText source for the User Reference Manual.
Loosely based on the manpage generator autodoc_man.py.
Written by the Bazaar community.
@@ -31,14 +31,6 @@
import bzrlib.osutils
-# Set this to True to generate a file per topic.
-# This probably ought to be an option. The files probably
-# ought to be prefixed with their section name as well so
-# there's zero risk of clashing with a standard sphinx
-# topic (like search.html).
-FILE_PER_TOPIC = False
-
-
def get_filename(options):
"""Provides name of manual"""
return "%s_man.txt" % (options.bzr_name)
@@ -74,8 +66,7 @@
output_dir=topic_dir))
result.append(_get_section(registry, SECT_LIST, "Lists",
output_dir=topic_dir))
- result.append(_get_commands_section(registry))
- #result.append(_get_section(registry, SECT_PLUGIN, "Standard Plug-ins"))
+ result.append(_get_commands_section(registry, output_dir=topic_dir))
return "\n".join(result)
@@ -86,72 +77,65 @@
If output_dir is not None, topics are dumped into text files there
during processing, as well as being included in the return result.
"""
+ file_per_topic = output_dir is not None
+ lines = [title, hdg_level1 * len(title), ""]
+ if file_per_topic:
+ lines.extend([".. toctree::", " :maxdepth: 1", ""])
+
topics = sorted(registry.get_topics_for_section(section))
- lines = [title, hdg_level1 * len(title), ""]
-
- # docutils treats section heading as implicit link target.
- # But in some cases topic and heading are different, e.g.:
- #
- # `bugs' vs. `Bug Trackers'
- # `working-tree' vs. `Working Trees'
- #
- # So for building proper cross-reference between topic names
- # and corresponding sections in document, we need provide
- # simple glue in the form:
- #
- # .. _topic: `heading`_
- links_glue = []
-
for topic in topics:
help = registry.get_detail(topic)
- heading,text = help.split("\n", 1)
- lines.append(heading)
+ heading, text = help.split("\n", 1)
if not text.startswith(hdg_level2):
- lines.append(hdg_level2 * len(heading))
- lines.append(text)
- lines.append('')
- # check that topic match heading
- if topic != heading.lower():
- links_glue.append((topic, heading))
- # dump the text if requested
- if output_dir is not None:
- out_file = bzrlib.osutils.pathjoin(output_dir, topic + ".txt")
- _dump_text(out_file, help)
-
- # provide links glue for topics that don't match headings
- lines.extend([".. _%s: `%s`_" % i for i in links_glue])
- lines.append('')
+ underline = hdg_level2 * len(heading)
+ help = "%s\n%s\n\n%s\n\n" % (heading, underline, text)
+ else:
+ help = "%s\n%s\n\n" % (heading, text)
+ if file_per_topic:
+ topic_id = _dump_text(output_dir, topic, help)
+ lines.append(" %s" % topic_id)
+ else:
+ lines.append(help)
return "\n" + "\n".join(lines) + "\n"
-def _dump_text(filename, text):
- """Dump text to filename."""
- if not FILE_PER_TOPIC:
- return
- f = open(filename, "w")
- f.writelines(text)
- f.close()
-
-
def _get_commands_section(registry, title="Commands", hdg_level1="#",
- hdg_level2="="):
+ hdg_level2="=", output_dir=None):
"""Build the commands reference section of the manual."""
+ file_per_topic = output_dir is not None
lines = [title, hdg_level1 * len(title), ""]
+ if file_per_topic:
+ lines.extend([".. toctree::", " :maxdepth: 1", ""])
+
cmds = sorted(bzrlib.commands.builtin_command_names())
for cmd_name in cmds:
cmd_object = bzrlib.commands.get_cmd_object(cmd_name)
if cmd_object.hidden:
continue
heading = cmd_name
+ underline = hdg_level2 * len(heading)
text = cmd_object.get_help_text(plain=False, see_also_as_links=True)
- lines.append(heading)
- lines.append(hdg_level2 * len(heading))
- lines.append(text)
- lines.append('')
+ help = "%s\n%s\n\n%s\n\n" % (heading, underline, text)
+ if file_per_topic:
+ topic_id = _dump_text(output_dir, cmd_name, help)
+ lines.append(" %s" % topic_id)
+ else:
+ lines.append(help)
+
return "\n" + "\n".join(lines) + "\n"
+def _dump_text(output_dir, topic, text):
+ """Dump text for a topic to a file."""
+ topic_id = "%s-%s" % (topic, "help")
+ filename = bzrlib.osutils.pathjoin(output_dir, topic_id + ".txt")
+ f = open(filename, "w")
+ f.writelines(text)
+ f.close()
+ return topic_id
+
+
##
# TEMPLATES
@@ -194,8 +178,8 @@
The following web sites provide further information on Bazaar:
-:Home page: http://www.bazaar-vcs.org/
-:Official docs: http://doc.bazaar-vcs.org/
+:Home page: http://bazaar.canonical.com/
+:Official docs: http://doc.bazaar.canonical.com/
:Launchpad: https://launchpad.net/bzr/
"""
=== modified file 'bzrlib/help_topics/__init__.py'
--- a/bzrlib/help_topics/__init__.py 2009-12-07 18:50:45 +0000
+++ b/bzrlib/help_topics/__init__.py 2010-01-08 07:34:31 +0000
@@ -306,7 +306,7 @@
"""Global Options
These options may be used with any command, and may appear in front of any
-command. (e.g. "bzr --profile help").
+command. (e.g. ``bzr --profile help``).
--version Print the version number. Must be supplied before the command.
--no-aliases Do not process command aliases when running this command.
@@ -325,9 +325,11 @@
will be a pickle.
--coverage Generate line coverage report in the specified directory.
-See doc/developers/profiling.txt for more information on profiling.
+See http://doc.bazaar.canonical.com/developers/profiling.html for more
+information on profiling.
+
A number of debug flags are also available to assist troubleshooting and
-development. See `bzr help debug-flags`.
+development. See :doc:`debug-flags-help`.
"""
_standard_options = \
@@ -647,7 +649,7 @@
differences.
"""
-_branches_out_of_sync = """Branches out of sync
+_branches_out_of_sync = """Branches Out of Sync
When reconfiguring a checkout, tree or branch into a lightweight checkout,
a local branch must be destroyed. (For checkouts, this is the local branch
@@ -682,18 +684,20 @@
project owner to upgrade.
-Note: Some of the older formats have two variants:
-a plain one and a rich-root one. The latter include an additional
-field about the root of the tree. There is no performance cost
-for using a rich-root format but you cannot easily merge changes
-from a rich-root format into a plain format. As a consequence,
-moving a project to a rich-root format takes some co-ordination
-in that all contributors need to upgrade their repositories
-around the same time. 2a and all future formats will be
-implicitly rich-root.
-
-See ``bzr help current-formats`` for the complete list of
-currently supported formats. See ``bzr help other-formats`` for
+.. note::
+
+ Some of the older formats have two variants:
+ a plain one and a rich-root one. The latter include an additional
+ field about the root of the tree. There is no performance cost
+ for using a rich-root format but you cannot easily merge changes
+ from a rich-root format into a plain format. As a consequence,
+ moving a project to a rich-root format takes some co-ordination
+ in that all contributors need to upgrade their repositories
+ around the same time. 2a and all future formats will be
+ implicitly rich-root.
+
+See :doc:`current-formats-help` for the complete list of
+currently supported formats. See :doc:`other-formats-help` for
descriptions of any available experimental and deprecated formats.
"""
@@ -742,14 +746,12 @@
'Information on configuring authentication')
topic_registry.register('configuration', _load_from_file,
'Details on the configuration settings available')
-topic_registry.register('conflicts', _load_from_file,
+topic_registry.register('conflict-types', _load_from_file,
'Types of conflicts and what to do about them')
topic_registry.register('debug-flags', _load_from_file,
'Options to show or record debug information')
topic_registry.register('log-formats', _load_from_file,
'Details on the logging formats available')
-topic_registry.register('diverged-branches', _load_from_file,
- 'How to fix diverged branches')
# Register concept topics.
@@ -763,6 +765,9 @@
topic_registry.register('content-filters', _load_from_file,
'Conversion of content into/from working trees',
SECT_CONCEPT)
+topic_registry.register('diverged-branches', _load_from_file,
+ 'How to fix diverged branches',
+ SECT_CONCEPT)
topic_registry.register('eol', _load_from_file,
'Information on end-of-line handling',
SECT_CONCEPT)
@@ -856,6 +861,7 @@
def help_as_plain_text(text):
"""Minimal converter of reStructuredText to plain text."""
+ import re
lines = text.splitlines()
result = []
for line in lines:
@@ -863,5 +869,7 @@
line = line[1:]
elif line.endswith('::'):
line = line[:-1]
+ # Map :doc:`xxx-help` to ``bzr help xxx``
+ line = re.sub(":doc:`(.+)-help`", r'``bzr help \1``', line)
result.append(line)
return "\n".join(result) + "\n"
=== modified file 'bzrlib/help_topics/en/authentication.txt'
--- a/bzrlib/help_topics/en/authentication.txt 2008-05-09 16:40:21 +0000
+++ b/bzrlib/help_topics/en/authentication.txt 2010-01-03 03:33:10 +0000
@@ -110,10 +110,8 @@
File format
-----------
-The general rules for `configuration files`_ apply except for the variable
-policies.
-
-.. _configuration files: #configuration-settings
+The general rules for :doc:`configuration files <configuration-help>`
+apply except for the variable policies.
Each section describes an authentication definition.
=== modified file 'bzrlib/help_topics/en/configuration.txt'
--- a/bzrlib/help_topics/en/configuration.txt 2009-12-15 20:32:34 +0000
+++ b/bzrlib/help_topics/en/configuration.txt 2010-01-03 03:33:10 +0000
@@ -272,7 +272,7 @@
variable policies which don't apply.
For more information on the possible uses of the authentication configuration
-file see `Authentication Settings`_.
+file see :doc:`authentication-help`.
Common variable options
=== renamed file 'bzrlib/help_topics/en/conflicts.txt' => 'bzrlib/help_topics/en/conflict-types.txt'
--- a/bzrlib/help_topics/en/conflicts.txt 2009-12-10 17:03:48 +0000
+++ b/bzrlib/help_topics/en/conflict-types.txt 2010-01-08 07:37:25 +0000
@@ -1,5 +1,5 @@
-Conflicts Types
-===============
+Conflict Types
+==============
Some operations, like merge, revert and pull, modify the contents of your
working tree. These modifications are programmatically generated, and so they
=== modified file 'bzrlib/help_topics/en/content-filters.txt'
--- a/bzrlib/help_topics/en/content-filters.txt 2009-02-25 06:41:51 +0000
+++ b/bzrlib/help_topics/en/content-filters.txt 2010-01-03 03:33:10 +0000
@@ -65,8 +65,8 @@
Note: ``bzr commit`` does not implicitly apply write converters after
comitting files. If this makes sense for a given plugin providing
a content filter, the plugin can usually achieve this effect by using a
-``start_commit`` or ``post_commit`` hook say. See ``bzr help hooks`` and
-`Using hooks`_ in the Bazaar User Guide for more information on hooks.
+``start_commit`` or ``post_commit`` hook say. See :doc:`hooks-help`
+for more information on hooks.
Refreshing your working tree
=== modified file 'bzrlib/help_topics/en/log-formats.txt'
--- a/bzrlib/help_topics/en/log-formats.txt 2009-02-09 08:19:18 +0000
+++ b/bzrlib/help_topics/en/log-formats.txt 2010-01-03 01:41:00 +0000
@@ -1,4 +1,4 @@
-Log formats
+Log Formats
===========
A log format controls how information about each revision is displayed.
=== modified file 'bzrlib/help_topics/en/rules.txt'
--- a/bzrlib/help_topics/en/rules.txt 2009-04-26 03:04:30 +0000
+++ b/bzrlib/help_topics/en/rules.txt 2010-01-03 03:33:10 +0000
@@ -16,8 +16,9 @@
Preferences like these are useful for commands and plugins wishing to
provide custom behaviour for selected files. For more information on
-end of line conversion see ``bzr help eol``. Keyword support is provided
-by the bzr-keywords plugin (http://launchpad.net/bzr-keywords).
+end of line conversion see :doc:`eol-help`.
+Keyword support is provided by the `keywords plugin
+<http://doc.bazaar.canonical.com/plugins/en/keywords-plugin.html>`_.
Files
-----
@@ -31,7 +32,9 @@
Patterns are ordered and searching stops as soon as one matches.
As a consequence, more explicit patterns should be placed towards
the top of the file. Rule patterns use exactly the same conventions
-as ignore patterns. See ``bzr help patterns`` for details.
-
-Note: Patterns containing square brackets or spaces should be
-surrounded in quotes to ensure they are correctly parsed.
+as ignore patterns. See :doc:`patterns-help` for details.
+
+.. note::
+
+ Patterns containing square brackets or spaces should be
+ surrounded in quotes to ensure they are correctly parsed.
=== modified file 'bzrlib/hooks.py'
--- a/bzrlib/hooks.py 2009-09-01 12:29:54 +0000
+++ b/bzrlib/hooks.py 2010-01-03 03:49:07 +0000
@@ -277,7 +277,7 @@
See `Using hooks`_ in the User Guide for examples.
-.. _Using hooks: ../user-guide/index.html#using-hooks
+.. _Using hooks: ../user-guide/hooks.html
The class that contains each hook is given before the hooks it supplies. For
instance, BranchHooks as the class is the hooks class for
=== modified file 'bzrlib/tests/test_bzrdir.py'
--- a/bzrlib/tests/test_bzrdir.py 2009-09-17 11:54:41 +0000
+++ b/bzrlib/tests/test_bzrdir.py 2010-01-08 07:34:31 +0000
@@ -145,7 +145,7 @@
new = topics.get_detail('current-formats')
rest = topics.get_detail('other-formats')
experimental, deprecated = rest.split('Deprecated formats')
- self.assertContainsRe(new, 'bzr help formats')
+ self.assertContainsRe(new, 'formats-help')
self.assertContainsRe(new,
':knit:\n \(native\) \(default\) Format using knits\n')
self.assertContainsRe(experimental,
=== modified file 'doc/en/user-guide/hooks.txt'
--- a/doc/en/user-guide/hooks.txt 2008-10-29 06:10:45 +0000
+++ b/doc/en/user-guide/hooks.txt 2010-01-03 03:49:07 +0000
@@ -8,18 +8,18 @@
perform actions before or after certain Bazaar operations. The operations
include ``commit``, ``push``, ``pull``, and ``uncommit``.
For a complete list of hooks and their parameters, see `Hooks
-<../user-reference/bzr_man.html#hooks>`_ in the User Reference.
+<../user-reference/hooks-help.html>`_ in the User Reference.
Most hooks are run on the client, but a few are run on the server. (Also
-see the `bzr-push-and-update`_ plugin that handles one special case of
+see the `push-and-update plugin`_ that handles one special case of
server-side operations.)
-.. _bzr-push-and-update: https://launchpad.net/bzr-push-and-update/
+.. _push-and-update plugin: http://doc.bazaar.canonical.com/plugins/en/push-and-update-plugin.html
Using hooks
-----------
-To use a hook, you should `write a plugin <#writing-a-plugin>`_. Instead of
+To use a hook, you should `write a plugin`_. Instead of
creating a new command, this plugin will define and install the hook. Here's
an example::
@@ -33,6 +33,8 @@
branch.Branch.hooks.install_named_hook('post_push', post_push_hook,
'My post_push hook')
+.. _write a plugin: http://doc.bazaar.canonical.com/plugins/en/plugin-development.html
+
To use this example, create a file named ``push_hook.py``, and stick it in
``plugins`` subdirectory of your configuration directory. (If you have never
installed any plugins, you may need to create the ``plugins`` directory).
More information about the bazaar-commits
mailing list