# HG changeset patch
# User Simon Heimberg <sim...@besonet.ch>
# Date 1310589726 -7200
# Node ID 76c38cd482bcdab9876ffb4d19cdffcbe6945bd5
# Parent  edf7854d2078a94962cd82bef76e1c22c41a96ea
hglib: new function extension_enabled

diff -r edf7854d2078 -r 76c38cd482bc tortoisehg/util/hglib.py
--- a/tortoisehg/util/hglib.py  Don Jul 21 20:02:54 2011 -0500
+++ b/tortoisehg/util/hglib.py  Mit Jul 13 22:42:06 2011 +0200
@@ -720,3 +720,16 @@
     else:
         # hg <= 1.8
         return hgdispatch._dispatch(ui, args)
+
+def extension_enabled(ui, ext, loaded = True):
+    'check if an extension is loaded by the given ui'
+    if loaded:
+        try:
+            extensons.find(ext)
+        except KeyError:
+            return False
+    uiext = ui.config('extensions', ext)
+    if bool(uiext) and uiext[0] != '!'
+        return True
+    uiext = ui.config('extensions', 'hgext.' + ext)
+        return bool(uiext) and uiext[0] != '!'

------------------------------------------------------------------------------
Storage Efficiency Calculator
This modeling tool is based on patent-pending intellectual property that
has been used successfully in hundreds of IBM storage optimization engage-
ments, worldwide.  Store less, Store more with what you own, Move data to 
the right place. Try It Now! http://www.accelacomm.com/jaw/sfnl/114/51427378/
_______________________________________________
Tortoisehg-develop mailing list
Tortoisehg-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop

Reply via email to