Patchwork D3421: firefoxtree: use logcmdutil.changesetdisplayer if available (bug 1456213); r?sheehan

login
register
mail settings
Submitter phabricator
Date April 23, 2018, 6:28 p.m.
Message ID <differential-rev-PHID-DREV-a7hqryfmogkhdjazfq2y-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/31211/
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 avoids a deprecation warning on Mercurial 4.6.

REPOSITORY
  rHG Mercurial

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

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
@@ -109,6 +109,11 @@ 
 
     # TRACKING hg46
     try:
+        from mercurial import logcmdutil
+    except ImportError:
+        logcmdutil = None
+
+    try:
         from mercurial import wireprotov1server as wireproto
     except ImportError:
         from mercurial import wireproto
@@ -557,7 +562,11 @@ 
     if not isfirefoxrepo(repo):
         raise util.Abort(_('fxheads is only available on Firefox repos'))
 
-    displayer = cmdutil.show_changeset(ui, repo, opts)
+    if logcmdutil:
+        displayer = logcmdutil.changesetdisplayer(ui, repo, opts)
+    else:
+        displayer = cmdutil.show_changeset(ui, repo, opts)
+
     seen = set()
     for tag, node, tree, uri in get_firefoxtrees(repo):
         if node in seen: