hgext/git/gitutil.py
changeset 45950 c7c1efdfd4de
parent 44484 ec54b3d2af0b
child 47012 d55b71393907
--- a/hgext/git/gitutil.py	Fri Nov 27 15:17:42 2020 -0500
+++ b/hgext/git/gitutil.py	Thu Nov 26 15:09:57 2020 -0500
@@ -20,6 +20,19 @@
     return pygit2_module
 
 
+def pygit2_version():
+    mod = get_pygit2()
+    v = "N/A"
+
+    if mod:
+        try:
+            v = mod.__version__
+        except AttributeError:
+            pass
+
+    return b"(pygit2 %s)" % v.encode("utf-8")
+
+
 def togitnode(n):
     """Wrapper to convert a Mercurial binary node to a unicode hexlified node.