mercurial/help/internals/extensions.txt
changeset 40597 04d08f17ce7a
parent 40596 252396a6a3f2
child 40729 c93d046d4300
--- a/mercurial/help/internals/extensions.txt	Mon Nov 12 22:26:24 2018 +0900
+++ b/mercurial/help/internals/extensions.txt	Mon Nov 12 22:51:36 2018 +0900
@@ -159,7 +159,8 @@
 then ``extsetup`` is called. This means ``extsetup`` can be useful in case
 one extension optionally depends on another extension.
 
-Both ``uisetup`` and ``extsetup`` receive a ui object::
+Both ``uisetup`` and ``extsetup`` receive a ui object with the local
+repository configuration::
 
     def uisetup(ui):
         # ...
@@ -167,6 +168,13 @@
     def extsetup(ui):
         # ...
 
+Be aware that ``uisetup`` in NOT the function to configure a ``ui`` instance.
+It's called only once per process, not per ``ui`` instance. Also, any changes
+to the ``ui`` may be discarded because the ``ui`` here temporarily loaded
+local configuration. So, it's generally wrong to do `ui.setconfig()` in
+these callbacks. Notable exception is setting ``pre/post-<command>`` hooks
+and extending ``ui.__class__``.
+
 In Mercurial 1.3.1 or earlier, ``extsetup`` takes no argument.
 
 Command table setup