##// END OF EJS Templates
help: document weird behavior of uisetup()...
Yuya Nishihara -
r40633:04d08f17 default
parent child Browse files
Show More
@@ -159,7 +159,8 b' There are two callbacks to be called whe'
159 then ``extsetup`` is called. This means ``extsetup`` can be useful in case
159 then ``extsetup`` is called. This means ``extsetup`` can be useful in case
160 one extension optionally depends on another extension.
160 one extension optionally depends on another extension.
161
161
162 Both ``uisetup`` and ``extsetup`` receive a ui object::
162 Both ``uisetup`` and ``extsetup`` receive a ui object with the local
163 repository configuration::
163
164
164 def uisetup(ui):
165 def uisetup(ui):
165 # ...
166 # ...
@@ -167,6 +168,13 b' Both ``uisetup`` and ``extsetup`` receiv'
167 def extsetup(ui):
168 def extsetup(ui):
168 # ...
169 # ...
169
170
171 Be aware that ``uisetup`` in NOT the function to configure a ``ui`` instance.
172 It's called only once per process, not per ``ui`` instance. Also, any changes
173 to the ``ui`` may be discarded because the ``ui`` here temporarily loaded
174 local configuration. So, it's generally wrong to do `ui.setconfig()` in
175 these callbacks. Notable exception is setting ``pre/post-<command>`` hooks
176 and extending ``ui.__class__``.
177
170 In Mercurial 1.3.1 or earlier, ``extsetup`` takes no argument.
178 In Mercurial 1.3.1 or earlier, ``extsetup`` takes no argument.
171
179
172 Command table setup
180 Command table setup
General Comments 0
You need to be logged in to leave comments. Login now