Patchwork D9448: helptext: document the mechanism for extensions to report a version

login
register
mail settings
Submitter phabricator
Date Nov. 28, 2020, 7:36 p.m.
Message ID <differential-rev-PHID-DREV-x4ezythnc7ssifiiftoi-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47726/
State Superseded
Headers show

Comments

phabricator - Nov. 28, 2020, 7:36 p.m.
mharbison72 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9448

AFFECTED FILES
  mercurial/helptext/internals/extensions.txt

CHANGE DETAILS




To: mharbison72, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/helptext/internals/extensions.txt b/mercurial/helptext/internals/extensions.txt
--- a/mercurial/helptext/internals/extensions.txt
+++ b/mercurial/helptext/internals/extensions.txt
@@ -322,6 +322,15 @@ 
 Older clients will print a warning that the extension requires a new version,
 instead of attempting to load it.
 
+The extension itself can be assigned a version value through one of two module
+attributes, and will be displayed in crash reports and  :hg:`version -v`::
+
+  * ``__version__`` is a plain value
+  * ``getversion`` is a no argument ``Callable`` that returns a value
+
+In both cases, the value must be either a byte string, or a list or tuple of
+numeric values which will be joined with ``.``.
+
 Wrap up: what belongs where?
 ============================