~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to doc/developers/plugin-api.txt

  • Committer: Vincent Ladeuil
  • Date: 2010-01-25 15:55:48 UTC
  • mto: (4985.1.4 add-attr-cleanup)
  • mto: This revision was merged to the branch mainline in revision 4988.
  • Revision ID: v.ladeuil+lp@free.fr-20100125155548-0l352pujvt5bzl5e
Deploy addAttrCleanup on the whole test suite.

Several use case worth mentioning:

- setting a module or any other object attribute is the majority
by far. In some cases the setting itself is deferred but most of
the time we want to set at the same time we add the cleanup.

- there multiple occurrences of protecting hooks or ui factory
which are now useless (the test framework takes care of that now),

- there was some lambda uses that can now be avoided.

That first cleanup already simplifies things a lot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
109
109
| bzr_repository_formats | {}      | As bzr_checkout_formats but for        |
110
110
|                        |         | repositories.                          |
111
111
+------------------------+---------+----------------------------------------+
 
112
| bzr_transports         | []      | URL prefixes for which this plugin     |
 
113
|                        |         | will register transports.              |
 
114
+------------------------+---------+----------------------------------------+
112
115
 
113
116
Control Formats
114
117
---------------
125
128
 
126
129
  # (look for a .hg directory)
127
130
  bzr_control_formats = {"Mercurial":{'.hg/': None}}
128
 
  
 
131
 
129
132
  # (look for a file called .svn/format with contents 4\n).
130
133
  bzr_control_formats = {"Subversion":{'.svn/format': '4\n'}}
131
134
 
134
137
-------
135
138
 
136
139
An example setup.py follows::
137
 
  
 
140
 
138
141
  #!/usr/bin/env python2.4
139
142
  from distutils.core import setup
140
 
  
 
143
 
141
144
  bzr_plugin_name = 'demo'
142
145
  bzr_commands = [
143
146
      'new-command',
144
147
      ]
145
 
  
 
148
 
146
149
  bzr_branch_formats = {
147
150
      "Branch label on disk\n":"demo branch",
148
151
      }
149
152
 
150
153
  bzr_control_formats = {"Subversion":{'.svn/format': '4\n'}}
151
 
  
 
154
 
 
155
  bzr_transports = ["hg+ssh://"]
 
156
 
152
157
  bzr_plugin_version = (1, 3, 0, 'dev', 0)
153
158
  bzr_minimum_version = (1, 0, 0)
154
 
  
 
159
 
155
160
  if __name__ == 'main':
156
161
      setup(name="Demo",
157
162
            version="1.3.0dev0",