##// END OF EJS Templates
exthelper: add a cautionary note about adding attributes to containers
Matt Harbison -
r41087:f7863606 default
parent child Browse files
Show More
@@ -246,6 +246,15 b' class exthelper(object):'
246 This function takes two arguments, the container and the name of the
246 This function takes two arguments, the container and the name of the
247 function to wrap. The wrapping is performed during `uisetup`.
247 function to wrap. The wrapping is performed during `uisetup`.
248
248
249 Adding attributes to a container like this is discouraged, because the
250 container modification is visible even in repositories that do not
251 have the extension loaded. Therefore, care must be taken that the
252 function doesn't make assumptions that the extension was loaded for the
253 current repository. For `ui` and `repo` instances, a better option is
254 to subclass the instance in `uipopulate` and `reposetup` respectively.
255
256 https://www.mercurial-scm.org/wiki/WritingExtensions
257
249 example::
258 example::
250
259
251 @eh.addattr(context.changectx, 'babar')
260 @eh.addattr(context.changectx, 'babar')
General Comments 0
You need to be logged in to leave comments. Login now