[PATCH 2 of 3] help: merge section about uisetup() and extsetup()

Yuya Nishihara yuya at tcha.org
Mon Nov 12 09:22:04 EST 2018


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1542029184 -32400
#      Mon Nov 12 22:26:24 2018 +0900
# Node ID f1ad5eaa63c8f4ac5a9b5c7553d40cc33792a34e
# Parent  0a27ee6fb750532b14363b82f0c02ca7d37868da
help: merge section about uisetup() and extsetup()

They are technically the same callback, called only once per process.
The section name "ui setup" is confusing, so shouldn't be used.

diff --git a/mercurial/help/internals/extensions.txt b/mercurial/help/internals/extensions.txt
--- a/mercurial/help/internals/extensions.txt
+++ b/mercurial/help/internals/extensions.txt
@@ -151,30 +151,23 @@ before the next phase begins. In the fir
 loaded and registered with Mercurial. This means that you can find all enabled
 extensions with ``extensions.find`` in the following phases.
 
-ui setup
---------
+Extension setup
+---------------
 
-Extensions can implement an optional callback named ``uisetup``. ``uisetup``
-is called when the extension is first loaded and receives a ui object::
+There are two callbacks to be called when extensions are loaded, named
+``uisetup`` and ``extsetup``. ``uisetup`` is called first for each extension,
+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::
 
     def uisetup(ui):
         # ...
 
-Extension setup
----------------
-
-Extensions can implement an optional callback named ``extsetup``. It is
-called after all the extension are loaded, and can be useful in case one
-extension optionally depends on another extension. Signature::
-
-    def extsetup():
+    def extsetup(ui):
         # ...
 
-Mercurial version 8e6019b16a7d and later (that is post-1.3.1) will pass
-a ``ui``` argument to ``extsetup``::
-
-    def extsetup(ui):
-        # ...
+In Mercurial 1.3.1 or earlier, ``extsetup`` takes no argument.
 
 Command table setup
 -------------------


More information about the Mercurial-devel mailing list