Patchwork D8248: debuginstall: print if Rust extensions are installed

login
register
mail settings
Submitter phabricator
Date March 6, 2020, 6:01 p.m.
Message ID <5fb2113297e27acd900c101f70ffe495@localhost.localdomain>
Download mbox | patch
Permalink /patch/45570/
State Not Applicable
Headers show

Comments

phabricator - March 6, 2020, 6:01 p.m.
Alphare updated this revision to Diff 20568.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8248?vs=20553&id=20568

BRANCH
  stable

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8248/new/

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

AFFECTED FILES
  mercurial/debugcommands.py
  tests/test-install.t

CHANGE DETAILS




To: Alphare, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/test-install.t b/tests/test-install.t
--- a/tests/test-install.t
+++ b/tests/test-install.t
@@ -8,6 +8,7 @@ 
   checking Python security support (*) (glob)
     TLS 1.2 not supported by Python install; network connections lack modern security (?)
     SNI not supported by Python install; may have connectivity issues with some servers (?)
+  checking Rust extensions \((installed|missing)\) (re)
   checking Mercurial version (*) (glob)
   checking Mercurial custom build (*) (glob)
   checking module policy (*) (glob)
@@ -64,6 +65,7 @@ 
   checking Python security support (*) (glob)
     TLS 1.2 not supported by Python install; network connections lack modern security (?)
     SNI not supported by Python install; may have connectivity issues with some servers (?)
+  checking Rust extensions \((installed|missing)\) (re)
   checking Mercurial version (*) (glob)
   checking Mercurial custom build (*) (glob)
   checking module policy (*) (glob)
@@ -109,6 +111,7 @@ 
   checking Python security support (*) (glob)
     TLS 1.2 not supported by Python install; network connections lack modern security (?)
     SNI not supported by Python install; may have connectivity issues with some servers (?)
+  checking Rust extensions \((installed|missing)\) (re)
   checking Mercurial version (*) (glob)
   checking Mercurial custom build (*) (glob)
   checking module policy (*) (glob)
@@ -134,6 +137,7 @@ 
   checking Python security support (*) (glob)
     TLS 1.2 not supported by Python install; network connections lack modern security (?)
     SNI not supported by Python install; may have connectivity issues with some servers (?)
+  checking Rust extensions \((installed|missing)\) (re)
   checking Mercurial version (*) (glob)
   checking Mercurial custom build (*) (glob)
   checking module policy (*) (glob)
@@ -188,6 +192,7 @@ 
   checking Python version (3.*) (glob)
   checking Python lib (*)... (glob)
   checking Python security support (*) (glob)
+  checking Rust extensions \((installed|missing)\) (re)
   checking Mercurial version (*) (glob)
   checking Mercurial custom build (*) (glob)
   checking module policy (*) (glob)
@@ -226,6 +231,7 @@ 
   checking Python security support (*) (glob)
     TLS 1.2 not supported by Python install; network connections lack modern security (?)
     SNI not supported by Python install; may have connectivity issues with some servers (?)
+  checking Rust extensions \((installed|missing)\) (re)
   checking Mercurial version (*) (glob)
   checking Mercurial custom build (*) (glob)
   checking module policy (*) (glob)
diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -1497,6 +1497,12 @@ 
         pythonlib or _(b"unknown"),
     )
 
+    try:
+        from mercurial import rustext
+        rustext.__doc__  # trigger lazy import
+    except ImportError:
+        rustext = None
+
     security = set(sslutil.supportedprotocols)
     if sslutil.hassni:
         security.add(b'sni')
@@ -1524,6 +1530,11 @@ 
             )
         )
 
+    fm.plain(
+        _(b"checking Rust extensions (%s)\n" % (b'missing'
+          if rustext is None else b'installed')),
+    )
+
     # TODO print CA cert info
 
     # hg version