Merge lp:~ian-clatworthy/bzr/user-ref-topics into lp:bzr

Proposed by Ian Clatworthy
Status: Merged
Approved by: Martin Pool
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~ian-clatworthy/bzr/user-ref-topics
Merge into: lp:bzr
Diff against target: 542 lines (+125/-94)
15 files modified
NEWS (+8/-1)
bzrlib/bugtracker.py (+19/-16)
bzrlib/bzrdir.py (+2/-2)
bzrlib/commands.py (+3/-2)
bzrlib/conflicts.py (+1/-1)
bzrlib/doc_generate/autodoc_rstx.py (+44/-32)
bzrlib/help_topics/__init__.py (+24/-19)
bzrlib/help_topics/en/authentication.txt (+2/-4)
bzrlib/help_topics/en/configuration.txt (+1/-1)
bzrlib/help_topics/en/conflict-types.txt (+2/-2)
bzrlib/help_topics/en/content-filters.txt (+2/-2)
bzrlib/help_topics/en/log-formats.txt (+1/-1)
bzrlib/help_topics/en/rules.txt (+9/-6)
bzrlib/hooks.py (+1/-1)
doc/en/user-guide/hooks.txt (+6/-4)
To merge this branch: bzr merge lp:~ian-clatworthy/bzr/user-ref-topics
Reviewer Review Type Date Requested Status
Martin Pool Needs Fixing
Review via email: mp+16750@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Ian Clatworthy (ian-clatworthy) wrote :

This branch formats the User Reference as a set of topics. Improving the formatting of the User Reference in this way was recently discussed and agreed to on the bzr-doc mailing list. The formatting and cross-linking of numerous topics has also been improved.

As a side effect of this change, each help topic is now available as http://doc.bazaar.canonical.com/test/en/user-reference/xxx-help.html. The old "conflicts" help topic has been renamed to "conflict-types" so that the conflicts command and it don't map to exactly the same URL.

Revision history for this message
Martin Pool (mbp) wrote :

The change of 'conflicts' name is good but should be in NEWS; perhaps the reformatting should be too.

Thanks

review: Needs Fixing
Revision history for this message
Ian Clatworthy (ian-clatworthy) wrote :

> The change of 'conflicts' name is good but should be in NEWS; perhaps the
> reformatting should be too.

Done.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'NEWS'
--- NEWS 2010-01-04 05:40:01 +0000
+++ NEWS 2010-01-04 08:49:20 +0000
@@ -79,7 +79,14 @@
7979
80* There is a System Administrator's Guide in ``doc/en/admin-guide``,80* There is a System Administrator's Guide in ``doc/en/admin-guide``,
81 including discussions of installation, relevant plugins, security and 81 including discussions of installation, relevant plugins, security and
82 backup.82 backup. (Neil Martinsen-Burrell)
83
84* The ``conflicts`` help topic has been renamed to ``conflict-types``.
85 (Ian Clatworthy)
86
87* The User Reference is now presented as a series of topics.
88 Many of the included topics have link and format tweaks applied.
89 (Ian Clatworthy)
8390
84API Changes91API Changes
85***********92***********
8693
=== modified file 'bzrlib/bugtracker.py'
--- bzrlib/bugtracker.py 2009-06-10 03:31:01 +0000
+++ bzrlib/bugtracker.py 2010-01-04 08:49:20 +0000
@@ -39,12 +39,12 @@
3939
40_bugs_help = \40_bugs_help = \
41"""When making a commit, metadata about bugs fixed by that change can be41"""When making a commit, metadata about bugs fixed by that change can be
42recorded by using the --fixes option. For each bug marked as fixed, an42recorded by using the ``--fixes`` option. For each bug marked as fixed, an
43entry is included in the 'bugs' revision property stating '<url> <status>'.43entry is included in the 'bugs' revision property stating '<url> <status>'.
44(The only ``status`` value currently supported is ``fixed.``)44(The only ``status`` value currently supported is ``fixed.``)
4545
46The --fixes option allows you to specify a bug tracker and a bug identifier46The ``--fixes`` option allows you to specify a bug tracker and a bug identifier
47rather than a full URL. This looks like47rather than a full URL. This looks like::
4848
49 bzr commit --fixes <tracker>:<id>49 bzr commit --fixes <tracker>:<id>
5050
@@ -56,10 +56,13 @@
56use this feature, you just need to know the tracker identifier to use.56use this feature, you just need to know the tracker identifier to use.
57These are the bugtrackers that are built in:57These are the bugtrackers that are built in:
5858
59 URL | Abbreviation | Example59 ============================ ============ ============
60 https://bugs.launchpad.net/ | lp | lp:1234560 URL Abbreviation Example
61 http://bugs.debian.org/ | deb | deb:1234561 ============================ ============ ============
62 http://bugzilla.gnome.org/ | gnome | gnome:1234562 https://bugs.launchpad.net/ lp lp:12345
63 http://bugs.debian.org/ deb deb:12345
64 http://bugzilla.gnome.org/ gnome gnome:12345
65 ============================ ============ ============
6366
64For the bug trackers not listed above configuration is required.67For the bug trackers not listed above configuration is required.
65Support for generating the URLs for any project using Bugzilla or Trac68Support for generating the URLs for any project using Bugzilla or Trac
@@ -82,11 +85,11 @@
8285
83Use ``bzr commit --fixes lp:2`` to record that this commit fixes bug 2.86Use ``bzr commit --fixes lp:2`` to record that this commit fixes bug 2.
8487
85bugzilla_<tracker_abbreviation>_url88bugzilla_<tracker>_url
86-----------------------------------89----------------------
8790
88If present, the location of the Bugzilla bug tracker referred to by91If present, the location of the Bugzilla bug tracker referred to by
89<tracker_abbreviation>. This option can then be used together with ``bzr commit92<tracker>. This option can then be used together with ``bzr commit
90--fixes`` to mark bugs in that tracker as being fixed by that commit. For93--fixes`` to mark bugs in that tracker as being fixed by that commit. For
91example::94example::
9295
@@ -95,11 +98,11 @@
95would allow ``bzr commit --fixes squid:1234`` to mark Squid's bug 1234 as98would allow ``bzr commit --fixes squid:1234`` to mark Squid's bug 1234 as
96fixed.99fixed.
97100
98trac_<tracker_abbrevation>_url101trac_<tracker>_url
99------------------------------102------------------
100103
101If present, the location of the Trac instance referred to by104If present, the location of the Trac instance referred to by
102<tracker_abbreviation>. This option can then be used together with ``bzr commit105<tracker>. This option can then be used together with ``bzr commit
103--fixes`` to mark bugs in that tracker as being fixed by that commit. For106--fixes`` to mark bugs in that tracker as being fixed by that commit. For
104example::107example::
105108
@@ -108,11 +111,11 @@
108would allow ``bzr commit --fixes twisted:1234`` to mark Twisted's bug 1234 as111would allow ``bzr commit --fixes twisted:1234`` to mark Twisted's bug 1234 as
109fixed.112fixed.
110113
111bugtracker_<tracker_abbrevation>_url114bugtracker_<tracker>_url
112------------------------------------115------------------------
113116
114If present, the location of a generic bug tracker instance referred to by117If present, the location of a generic bug tracker instance referred to by
115<tracker_abbreviation>. The location must contain an ``{id}`` placeholder,118<tracker>. The location must contain an ``{id}`` placeholder,
116which will be replaced by a specific bug ID. This option can then be used119which will be replaced by a specific bug ID. This option can then be used
117together with ``bzr commit --fixes`` to mark bugs in that tracker as being120together with ``bzr commit --fixes`` to mark bugs in that tracker as being
118fixed by that commit. For example::121fixed by that commit. For example::
119122
=== modified file 'bzrlib/bzrdir.py'
--- bzrlib/bzrdir.py 2009-12-02 17:56:06 +0000
+++ bzrlib/bzrdir.py 2010-01-04 08:49:20 +0000
@@ -3513,7 +3513,7 @@
3513 experimental_pairs.append((key, help))3513 experimental_pairs.append((key, help))
3514 else:3514 else:
3515 output += wrapped(key, help, info)3515 output += wrapped(key, help, info)
3516 output += "\nSee ``bzr help formats`` for more about storage formats."3516 output += "\nSee :doc:`formats-help` for more about storage formats."
3517 other_output = ""3517 other_output = ""
3518 if len(experimental_pairs) > 0:3518 if len(experimental_pairs) > 0:
3519 other_output += "Experimental formats are shown below.\n\n"3519 other_output += "Experimental formats are shown below.\n\n"
@@ -3532,7 +3532,7 @@
3532 other_output += \3532 other_output += \
3533 "\nNo deprecated formats are available.\n\n"3533 "\nNo deprecated formats are available.\n\n"
3534 other_output += \3534 other_output += \
3535 "\nSee ``bzr help formats`` for more about storage formats."3535 "\nSee :doc:`formats-help` for more about storage formats."
35363536
3537 if topic == 'other-formats':3537 if topic == 'other-formats':
3538 return other_output3538 return other_output
35393539
=== modified file 'bzrlib/commands.py'
--- bzrlib/commands.py 2009-12-09 05:47:32 +0000
+++ bzrlib/commands.py 2010-01-04 08:49:20 +0000
@@ -511,8 +511,9 @@
511 # so don't create a real link511 # so don't create a real link
512 see_also_links.append(item)512 see_also_links.append(item)
513 else:513 else:
514 # Use a reST link for this entry514 # Use a Sphinx link for this entry
515 see_also_links.append("`%s`_" % (item,))515 link_text = ":doc:`%s <%s-help>`" % (item, item)
516 see_also_links.append(link_text)
516 see_also = see_also_links517 see_also = see_also_links
517 result += ':See also: '518 result += ':See also: '
518 result += ', '.join(see_also) + '\n'519 result += ', '.join(see_also) + '\n'
519520
=== modified file 'bzrlib/conflicts.py'
--- bzrlib/conflicts.py 2009-11-23 03:15:33 +0000
+++ bzrlib/conflicts.py 2010-01-04 08:49:20 +0000
@@ -58,7 +58,7 @@
58 Option('text',58 Option('text',
59 help='List paths of files with text conflicts.'),59 help='List paths of files with text conflicts.'),
60 ]60 ]
61 _see_also = ['resolve']61 _see_also = ['resolve', 'conflict-types']
6262
63 def run(self, text=False):63 def run(self, text=False):
64 from bzrlib.workingtree import WorkingTree64 from bzrlib.workingtree import WorkingTree
6565
=== modified file 'bzrlib/doc_generate/autodoc_rstx.py'
--- bzrlib/doc_generate/autodoc_rstx.py 2009-09-09 14:35:26 +0000
+++ bzrlib/doc_generate/autodoc_rstx.py 2010-01-04 08:49:20 +0000
@@ -14,7 +14,7 @@
14# along with this program; if not, write to the Free Software14# along with this program; if not, write to the Free Software
15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1616
17"""Generate ReStructuredText source for the User Reference Manual.17"""Generate reStructuredText source for the User Reference Manual.
18Loosely based on the manpage generator autodoc_man.py.18Loosely based on the manpage generator autodoc_man.py.
1919
20Written by the Bazaar community.20Written by the Bazaar community.
@@ -36,7 +36,7 @@
36# ought to be prefixed with their section name as well so36# ought to be prefixed with their section name as well so
37# there's zero risk of clashing with a standard sphinx37# there's zero risk of clashing with a standard sphinx
38# topic (like search.html).38# topic (like search.html).
39FILE_PER_TOPIC = False39FILE_PER_TOPIC = True
4040
4141
42def get_filename(options):42def get_filename(options):
@@ -74,8 +74,7 @@
74 output_dir=topic_dir))74 output_dir=topic_dir))
75 result.append(_get_section(registry, SECT_LIST, "Lists",75 result.append(_get_section(registry, SECT_LIST, "Lists",
76 output_dir=topic_dir))76 output_dir=topic_dir))
77 result.append(_get_commands_section(registry))77 result.append(_get_commands_section(registry, output_dir=topic_dir))
78 #result.append(_get_section(registry, SECT_PLUGIN, "Standard Plug-ins"))
79 return "\n".join(result)78 return "\n".join(result)
8079
8180
@@ -86,8 +85,9 @@
86 If output_dir is not None, topics are dumped into text files there85 If output_dir is not None, topics are dumped into text files there
87 during processing, as well as being included in the return result.86 during processing, as well as being included in the return result.
88 """87 """
89 topics = sorted(registry.get_topics_for_section(section))
90 lines = [title, hdg_level1 * len(title), ""]88 lines = [title, hdg_level1 * len(title), ""]
89 if FILE_PER_TOPIC:
90 lines.extend([".. toctree::", " :maxdepth: 1", ""])
9191
92 # docutils treats section heading as implicit link target.92 # docutils treats section heading as implicit link target.
93 # But in some cases topic and heading are different, e.g.:93 # But in some cases topic and heading are different, e.g.:
@@ -102,56 +102,68 @@
102 # .. _topic: `heading`_102 # .. _topic: `heading`_
103 links_glue = []103 links_glue = []
104104
105 topics = sorted(registry.get_topics_for_section(section))
105 for topic in topics:106 for topic in topics:
106 help = registry.get_detail(topic)107 help = registry.get_detail(topic)
107 heading,text = help.split("\n", 1)108 heading, text = help.split("\n", 1)
108 lines.append(heading)
109 if not text.startswith(hdg_level2):109 if not text.startswith(hdg_level2):
110 lines.append(hdg_level2 * len(heading))110 underline = hdg_level2 * len(heading)
111 lines.append(text)111 help = "%s\n%s\n\n%s\n\n" % (heading, underline, text)
112 lines.append('')112 else:
113 help = "%s\n%s\n\n" % (heading, text)
114 if FILE_PER_TOPIC:
115 topic_id = _dump_text(output_dir, topic, help)
116 lines.append(" %s" % topic_id)
117 else:
118 lines.append(help)
119
113 # check that topic match heading120 # check that topic match heading
114 if topic != heading.lower():121 if topic != heading.lower():
115 links_glue.append((topic, heading))122 links_glue.append((topic, heading))
116 # dump the text if requested
117 if output_dir is not None:
118 out_file = bzrlib.osutils.pathjoin(output_dir, topic + ".txt")
119 _dump_text(out_file, help)
120123
121 # provide links glue for topics that don't match headings124 # provide links glue for topics that don't match headings
122 lines.extend([".. _%s: `%s`_" % i for i in links_glue])125 #lines.append('')
123 lines.append('')126 #lines.extend([".. _%s: `%s`_" % i for i in links_glue])
127 #lines.append('')
124128
125 return "\n" + "\n".join(lines) + "\n"129 return "\n" + "\n".join(lines) + "\n"
126130
127131
128def _dump_text(filename, text):
129 """Dump text to filename."""
130 if not FILE_PER_TOPIC:
131 return
132 f = open(filename, "w")
133 f.writelines(text)
134 f.close()
135
136
137def _get_commands_section(registry, title="Commands", hdg_level1="#",132def _get_commands_section(registry, title="Commands", hdg_level1="#",
138 hdg_level2="="):133 hdg_level2="=", output_dir=None):
139 """Build the commands reference section of the manual."""134 """Build the commands reference section of the manual."""
140 lines = [title, hdg_level1 * len(title), ""]135 lines = [title, hdg_level1 * len(title), ""]
136 if FILE_PER_TOPIC:
137 lines.extend([".. toctree::", " :maxdepth: 1", ""])
138
141 cmds = sorted(bzrlib.commands.builtin_command_names())139 cmds = sorted(bzrlib.commands.builtin_command_names())
142 for cmd_name in cmds:140 for cmd_name in cmds:
143 cmd_object = bzrlib.commands.get_cmd_object(cmd_name)141 cmd_object = bzrlib.commands.get_cmd_object(cmd_name)
144 if cmd_object.hidden:142 if cmd_object.hidden:
145 continue143 continue
146 heading = cmd_name144 heading = cmd_name
145 underline = hdg_level2 * len(heading)
147 text = cmd_object.get_help_text(plain=False, see_also_as_links=True)146 text = cmd_object.get_help_text(plain=False, see_also_as_links=True)
148 lines.append(heading)147 help = "%s\n%s\n\n%s\n\n" % (heading, underline, text)
149 lines.append(hdg_level2 * len(heading))148 if FILE_PER_TOPIC:
150 lines.append(text)149 topic_id = _dump_text(output_dir, cmd_name, help)
151 lines.append('')150 lines.append(" %s" % topic_id)
151 else:
152 lines.append(help)
153
152 return "\n" + "\n".join(lines) + "\n"154 return "\n" + "\n".join(lines) + "\n"
153155
154156
157def _dump_text(output_dir, topic, text):
158 """Dump text for a topic to a file."""
159 topic_id = "%s-%s" % (topic, "help")
160 filename = bzrlib.osutils.pathjoin(output_dir, topic_id + ".txt")
161 f = open(filename, "w")
162 f.writelines(text)
163 f.close()
164 return topic_id
165
166
155##167##
156# TEMPLATES168# TEMPLATES
157169
@@ -194,8 +206,8 @@
194206
195The following web sites provide further information on Bazaar:207The following web sites provide further information on Bazaar:
196208
197:Home page: http://www.bazaar-vcs.org/209:Home page: http://bazaar.canonical.com/
198:Official docs: http://doc.bazaar-vcs.org/210:Official docs: http://doc.bazaar.canonical.com/
199:Launchpad: https://launchpad.net/bzr/211:Launchpad: https://launchpad.net/bzr/
200"""212"""
201213
202214
=== modified file 'bzrlib/help_topics/__init__.py'
--- bzrlib/help_topics/__init__.py 2009-12-07 18:50:45 +0000
+++ bzrlib/help_topics/__init__.py 2010-01-04 08:49:20 +0000
@@ -306,7 +306,7 @@
306"""Global Options306"""Global Options
307307
308These options may be used with any command, and may appear in front of any308These options may be used with any command, and may appear in front of any
309command. (e.g. "bzr --profile help").309command. (e.g. ``bzr --profile help``).
310310
311--version Print the version number. Must be supplied before the command.311--version Print the version number. Must be supplied before the command.
312--no-aliases Do not process command aliases when running this command.312--no-aliases Do not process command aliases when running this command.
@@ -325,9 +325,11 @@
325 will be a pickle.325 will be a pickle.
326--coverage Generate line coverage report in the specified directory.326--coverage Generate line coverage report in the specified directory.
327327
328See doc/developers/profiling.txt for more information on profiling.328See http://doc.bazaar.canonical.com/developers/profiling.html for more
329information on profiling.
330
329A number of debug flags are also available to assist troubleshooting and331A number of debug flags are also available to assist troubleshooting and
330development. See `bzr help debug-flags`.332development. See :doc:`debug-flags-help`.
331"""333"""
332334
333_standard_options = \335_standard_options = \
@@ -647,7 +649,7 @@
647differences.649differences.
648"""650"""
649651
650_branches_out_of_sync = """Branches out of sync652_branches_out_of_sync = """Branches Out of Sync
651653
652When reconfiguring a checkout, tree or branch into a lightweight checkout,654When reconfiguring a checkout, tree or branch into a lightweight checkout,
653a local branch must be destroyed. (For checkouts, this is the local branch655a local branch must be destroyed. (For checkouts, this is the local branch
@@ -682,18 +684,20 @@
682project owner to upgrade.684project owner to upgrade.
683685
684686
685Note: Some of the older formats have two variants:687.. note::
686a plain one and a rich-root one. The latter include an additional688
687field about the root of the tree. There is no performance cost689 Some of the older formats have two variants:
688for using a rich-root format but you cannot easily merge changes690 a plain one and a rich-root one. The latter include an additional
689from a rich-root format into a plain format. As a consequence,691 field about the root of the tree. There is no performance cost
690moving a project to a rich-root format takes some co-ordination692 for using a rich-root format but you cannot easily merge changes
691in that all contributors need to upgrade their repositories693 from a rich-root format into a plain format. As a consequence,
692around the same time. 2a and all future formats will be694 moving a project to a rich-root format takes some co-ordination
693implicitly rich-root.695 in that all contributors need to upgrade their repositories
694696 around the same time. 2a and all future formats will be
695See ``bzr help current-formats`` for the complete list of697 implicitly rich-root.
696currently supported formats. See ``bzr help other-formats`` for698
699See :doc:`current-formats-help` for the complete list of
700currently supported formats. See :doc:`other-formats-help` for
697descriptions of any available experimental and deprecated formats.701descriptions of any available experimental and deprecated formats.
698"""702"""
699703
@@ -742,14 +746,12 @@
742 'Information on configuring authentication')746 'Information on configuring authentication')
743topic_registry.register('configuration', _load_from_file,747topic_registry.register('configuration', _load_from_file,
744 'Details on the configuration settings available')748 'Details on the configuration settings available')
745topic_registry.register('conflicts', _load_from_file,749topic_registry.register('conflict-types', _load_from_file,
746 'Types of conflicts and what to do about them')750 'Types of conflicts and what to do about them')
747topic_registry.register('debug-flags', _load_from_file,751topic_registry.register('debug-flags', _load_from_file,
748 'Options to show or record debug information')752 'Options to show or record debug information')
749topic_registry.register('log-formats', _load_from_file,753topic_registry.register('log-formats', _load_from_file,
750 'Details on the logging formats available')754 'Details on the logging formats available')
751topic_registry.register('diverged-branches', _load_from_file,
752 'How to fix diverged branches')
753755
754756
755# Register concept topics.757# Register concept topics.
@@ -763,6 +765,9 @@
763topic_registry.register('content-filters', _load_from_file,765topic_registry.register('content-filters', _load_from_file,
764 'Conversion of content into/from working trees',766 'Conversion of content into/from working trees',
765 SECT_CONCEPT)767 SECT_CONCEPT)
768topic_registry.register('diverged-branches', _load_from_file,
769 'How to fix diverged branches',
770 SECT_CONCEPT)
766topic_registry.register('eol', _load_from_file,771topic_registry.register('eol', _load_from_file,
767 'Information on end-of-line handling',772 'Information on end-of-line handling',
768 SECT_CONCEPT)773 SECT_CONCEPT)
769774
=== modified file 'bzrlib/help_topics/en/authentication.txt'
--- bzrlib/help_topics/en/authentication.txt 2008-05-09 16:40:21 +0000
+++ bzrlib/help_topics/en/authentication.txt 2010-01-04 08:49:20 +0000
@@ -110,10 +110,8 @@
110File format110File format
111-----------111-----------
112112
113The general rules for `configuration files`_ apply except for the variable113The general rules for :doc:`configuration files <configuration-help>`
114policies.114apply except for the variable policies.
115
116.. _configuration files: #configuration-settings
117115
118Each section describes an authentication definition.116Each section describes an authentication definition.
119117
120118
=== modified file 'bzrlib/help_topics/en/configuration.txt'
--- bzrlib/help_topics/en/configuration.txt 2009-12-15 20:32:34 +0000
+++ bzrlib/help_topics/en/configuration.txt 2010-01-04 08:49:20 +0000
@@ -272,7 +272,7 @@
272variable policies which don't apply.272variable policies which don't apply.
273273
274For more information on the possible uses of the authentication configuration274For more information on the possible uses of the authentication configuration
275file see `Authentication Settings`_.275file see :doc:`authentication-help`.
276276
277277
278Common variable options278Common variable options
279279
=== renamed file 'bzrlib/help_topics/en/conflicts.txt' => 'bzrlib/help_topics/en/conflict-types.txt'
--- bzrlib/help_topics/en/conflicts.txt 2009-11-25 16:42:55 +0000
+++ bzrlib/help_topics/en/conflict-types.txt 2010-01-04 08:49:20 +0000
@@ -1,5 +1,5 @@
1Conflicts Types1Conflict Types
2===============2==============
33
4Some operations, like merge, revert and pull, modify the contents of your4Some operations, like merge, revert and pull, modify the contents of your
5working tree. These modifications are programmatically generated, and so they5working tree. These modifications are programmatically generated, and so they
66
=== modified file 'bzrlib/help_topics/en/content-filters.txt'
--- bzrlib/help_topics/en/content-filters.txt 2009-02-25 06:41:51 +0000
+++ bzrlib/help_topics/en/content-filters.txt 2010-01-04 08:49:20 +0000
@@ -65,8 +65,8 @@
65Note: ``bzr commit`` does not implicitly apply write converters after65Note: ``bzr commit`` does not implicitly apply write converters after
66comitting files. If this makes sense for a given plugin providing66comitting files. If this makes sense for a given plugin providing
67a content filter, the plugin can usually achieve this effect by using a67a content filter, the plugin can usually achieve this effect by using a
68``start_commit`` or ``post_commit`` hook say. See ``bzr help hooks`` and68``start_commit`` or ``post_commit`` hook say. See :doc:`hooks-help`
69`Using hooks`_ in the Bazaar User Guide for more information on hooks.69for more information on hooks.
7070
7171
72Refreshing your working tree72Refreshing your working tree
7373
=== modified file 'bzrlib/help_topics/en/log-formats.txt'
--- bzrlib/help_topics/en/log-formats.txt 2009-02-09 08:19:18 +0000
+++ bzrlib/help_topics/en/log-formats.txt 2010-01-04 08:49:20 +0000
@@ -1,4 +1,4 @@
1Log formats1Log Formats
2===========2===========
33
4A log format controls how information about each revision is displayed.4A log format controls how information about each revision is displayed.
55
=== modified file 'bzrlib/help_topics/en/rules.txt'
--- bzrlib/help_topics/en/rules.txt 2009-04-26 03:04:30 +0000
+++ bzrlib/help_topics/en/rules.txt 2010-01-04 08:49:20 +0000
@@ -16,8 +16,9 @@
1616
17Preferences like these are useful for commands and plugins wishing to17Preferences like these are useful for commands and plugins wishing to
18provide custom behaviour for selected files. For more information on 18provide custom behaviour for selected files. For more information on
19end of line conversion see ``bzr help eol``. Keyword support is provided19end of line conversion see :doc:`eol-help`.
20by the bzr-keywords plugin (http://launchpad.net/bzr-keywords).20Keyword support is provided by the `keywords plugin
21<http://doc.bazaar.canonical.com/plugins/en/keywords-plugin.html>`_.
2122
22Files23Files
23-----24-----
@@ -31,7 +32,9 @@
31Patterns are ordered and searching stops as soon as one matches.32Patterns are ordered and searching stops as soon as one matches.
32As a consequence, more explicit patterns should be placed towards33As a consequence, more explicit patterns should be placed towards
33the top of the file. Rule patterns use exactly the same conventions34the top of the file. Rule patterns use exactly the same conventions
34as ignore patterns. See ``bzr help patterns`` for details.35as ignore patterns. See :doc:`patterns-help` for details.
3536
36Note: Patterns containing square brackets or spaces should be37.. note::
37surrounded in quotes to ensure they are correctly parsed.38
39 Patterns containing square brackets or spaces should be
40 surrounded in quotes to ensure they are correctly parsed.
3841
=== modified file 'bzrlib/hooks.py'
--- bzrlib/hooks.py 2009-09-01 12:29:54 +0000
+++ bzrlib/hooks.py 2010-01-04 08:49:20 +0000
@@ -277,7 +277,7 @@
277277
278See `Using hooks`_ in the User Guide for examples.278See `Using hooks`_ in the User Guide for examples.
279279
280.. _Using hooks: ../user-guide/index.html#using-hooks280.. _Using hooks: ../user-guide/hooks.html
281281
282The class that contains each hook is given before the hooks it supplies. For282The class that contains each hook is given before the hooks it supplies. For
283instance, BranchHooks as the class is the hooks class for283instance, BranchHooks as the class is the hooks class for
284284
=== modified file 'doc/en/user-guide/hooks.txt'
--- doc/en/user-guide/hooks.txt 2008-10-29 06:10:45 +0000
+++ doc/en/user-guide/hooks.txt 2010-01-04 08:49:20 +0000
@@ -8,18 +8,18 @@
8perform actions before or after certain Bazaar operations. The operations8perform actions before or after certain Bazaar operations. The operations
9include ``commit``, ``push``, ``pull``, and ``uncommit``.9include ``commit``, ``push``, ``pull``, and ``uncommit``.
10For a complete list of hooks and their parameters, see `Hooks10For a complete list of hooks and their parameters, see `Hooks
11<../user-reference/bzr_man.html#hooks>`_ in the User Reference.11<../user-reference/hooks-help.html>`_ in the User Reference.
1212
13Most hooks are run on the client, but a few are run on the server. (Also13Most hooks are run on the client, but a few are run on the server. (Also
14see the `bzr-push-and-update`_ plugin that handles one special case of14see the `push-and-update plugin`_ that handles one special case of
15server-side operations.)15server-side operations.)
1616
17.. _bzr-push-and-update: https://launchpad.net/bzr-push-and-update/17.. _push-and-update plugin: http://doc.bazaar.canonical.com/plugins/en/push-and-update-plugin.html
1818
19Using hooks19Using hooks
20-----------20-----------
2121
22To use a hook, you should `write a plugin <#writing-a-plugin>`_. Instead of22To use a hook, you should `write a plugin`_. Instead of
23creating a new command, this plugin will define and install the hook. Here's23creating a new command, this plugin will define and install the hook. Here's
24an example::24an example::
2525
@@ -33,6 +33,8 @@
33 branch.Branch.hooks.install_named_hook('post_push', post_push_hook,33 branch.Branch.hooks.install_named_hook('post_push', post_push_hook,
34 'My post_push hook')34 'My post_push hook')
3535
36.. _write a plugin: http://doc.bazaar.canonical.com/plugins/en/plugin-development.html
37
36To use this example, create a file named ``push_hook.py``, and stick it in38To use this example, create a file named ``push_hook.py``, and stick it in
37``plugins`` subdirectory of your configuration directory. (If you have never39``plugins`` subdirectory of your configuration directory. (If you have never
38installed any plugins, you may need to create the ``plugins`` directory).40installed any plugins, you may need to create the ``plugins`` directory).