This is an archive of the discontinued Mercurial Phabricator instance.

debuginstall: print if Rust extensions are installed
ClosedPublic

Authored by Alphare on Mar 6 2020, 8:45 AM.

Details

Summary

This should make it easier to use the Rust extensions.

Another patch on will be exposing a version and more useful information, but
it can only be done on top of this very patch, since it is targeting the stable
branch and the API has already changed on the default branch.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Alphare created this revision.Mar 6 2020, 8:45 AM
Alphare updated this revision to Diff 20553.Mar 6 2020, 8:51 AM
Alphare updated this revision to Diff 20568.Mar 6 2020, 1:00 PM
pulkit accepted this revision.Mar 9 2020, 4:51 AM
This revision is now accepted and ready to land.Mar 9 2020, 4:51 AM
pulkit added a comment.Mar 9 2020, 5:46 AM

Amended the following to make test-check-module-imports.t happy.

diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -1509,7 +1509,7 @@ def debuginstall(ui, **opts):
     )
 
     try:
-        from mercurial import rustext
+        from . import rustext
         rustext.__doc__  # trigger lazy import
     except ImportError:
         rustext = None
pulkit added a comment.Mar 9 2020, 5:54 AM

and the following too to make test-check-format.t happy.

diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -1510,6 +1510,7 @@ def debuginstall(ui, **opts):
 
     try:
         from . import rustext
+
         rustext.__doc__  # trigger lazy import
     except ImportError:
         rustext = None
@@ -1542,8 +1543,10 @@ def debuginstall(ui, **opts):
         )
 
     fm.plain(
-        _(b"checking Rust extensions (%s)\n" % (b'missing'
-          if rustext is None else b'installed')),
+        _(
+            b"checking Rust extensions (%s)\n"
+            % (b'missing' if rustext is None else b'installed')
+        ),
     )
 
     # TODO print CA cert info
This revision was automatically updated to reflect the committed changes.