Steve Borho avatar Steve Borho committed 043e803

hglib: extensions.enable and disable no longer return a tuple

Comments (0)

Files changed (1)

tortoisehg/util/hglib.py

 
     shortdesc is in local encoding.
     """
-    return extensions.enabled()[0]
+    ret = extensions.enabled()
+    if type(ret) is tuple:
+        # hg <= 1.8
+        return ret[0]
+    else:
+        # hg <= 1.9
+        return ret
+
+def disabledextensions():
+    ret = extensions.disabled()
+    if type(ret) is tuple:
+        # hg <= 1.8
+        return ret[0] or {}
+    else:
+        # hg <= 1.9
+        return ret or {}
 
 def allextensions():
     """Return the {name: shortdesc} dict of known extensions
     shortdesc is in local encoding.
     """
     enabledexts = enabledextensions()
-    disabledexts = extensions.disabled()[0]
+    disabledexts = disabledextensions()
     exts = (disabledexts or {}).copy()
     exts.update(enabledexts)
     return exts
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.