Patchwork D3420: firefoxtree: look for renamed wire protocol module (bug 1456213); r?sheehan

login
register
mail settings
Submitter phabricator
Date April 23, 2018, 6:28 p.m.
Message ID <differential-rev-PHID-DREV-pl3eo7vzegcqsuwsq7p4-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/31210/
State Superseded
Headers show

Comments

phabricator - April 23, 2018, 6:28 p.m.
indygreg created this revision.
indygreg added a reviewer: sheehan.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This enables the firefoxtree extension to load with Mercurial 4.6.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3420

AFFECTED FILES
  hgext/firefoxtree/__init__.py

CHANGE DETAILS




To: indygreg, sheehan, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/hgext/firefoxtree/__init__.py b/hgext/firefoxtree/__init__.py
--- a/hgext/firefoxtree/__init__.py
+++ b/hgext/firefoxtree/__init__.py
@@ -79,6 +79,7 @@ 
     bookmarks,
     cmdutil,
     commands,
+    demandimport,
     error,
     exchange,
     extensions,
@@ -89,7 +90,6 @@ 
     scmutil,
     templatekw,
     util,
-    wireproto,
 )
 from mercurial.error import RepoError
 from mercurial.i18n import _
@@ -100,11 +100,18 @@ 
     short,
 )
 
-# TRACKING hg43
-try:
-    from mercurial import configitems
-except ImportError:
-    configitems = None
+with demandimport.deactivated():
+    # TRACKING hg43
+    try:
+        from mercurial import configitems
+    except ImportError:
+        configitems = None
+
+    # TRACKING hg46
+    try:
+        from mercurial import wireprotov1server as wireproto
+    except ImportError:
+        from mercurial import wireproto
 
 OUR_DIR = os.path.dirname(__file__)
 execfile(os.path.join(OUR_DIR, '..', 'bootstrap.py'))