5648fb65dcd5 — Steve Fink 6 years ago
hg 4.3+ compatibility
1 files changed, 17 insertions(+), 4 deletions(-)

M __init__.py
M __init__.py +17 -4
@@ 6,10 6,14 @@ import re
 import os
 import sys
 
-from mercurial import cmdutil, commands, context, extensions, util
-
-cmdtable = {}
-command = cmdutil.command(cmdtable)
+from mercurial import (
+    cmdutil,
+    commands,
+    context,
+    extensions,
+    registrar,
+    util
+)
 
 try:
     from menu import make_selector

          
@@ 27,6 31,14 @@ except:
     def json_load(datafile):
         return eval(datafile.read(), {})
 
+cmdtable = {}
+
+# TRACKING hg43
+if util.safehasattr(registrar, 'command'):
+    command = registrar.command(cmdtable)
+else:
+    command = cmdutil.command(cmdtable)
+
 SCRIPTDIR = os.path.dirname(os.path.realpath(__file__))
 data = json_load(file(os.path.join(SCRIPTDIR, "jobs.json")))
 

          
@@ 289,5 301,6 @@ def trychooser_command(ui, repo, *args, 
     ui.write("Push to try server...\n")
     commands.push(ui, repo, opts['server'], force=True, rev=[repo[m].rev()])
 
+    trans.abort()
     # Intentionally do not commit the transaction, so it will abort and undo
     # the temporary changeset.