compat: drop compatibility layer for pager
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 19 Apr 2018 16:27:13 +0200
changeset 3701 29c413a7dfb5
parent 3700 2577fdc3a458
child 3702 f6979d64b9fb
compat: drop compatibility layer for pager All versions we support now support `ui.pager`.
hgext3rd/evolve/compat.py
hgext3rd/evolve/evolvecmd.py
hgext3rd/evolve/obshistory.py
hgext3rd/topic/__init__.py
hgext3rd/topic/compat.py
--- a/hgext3rd/evolve/compat.py	Thu Apr 19 16:25:17 2018 +0200
+++ b/hgext3rd/evolve/compat.py	Thu Apr 19 16:27:13 2018 +0200
@@ -122,11 +122,6 @@
 if not util.safehasattr(obsolete, '_computephasedivergentset'):
     obsolete._computephasedivergentset = obsolete.cachefor('phasedivergent')(obsolete._computebumpedset)
 
-def startpager(ui, cmd):
-    """function to start a pager in case ui.pager() exists"""
-    if util.safehasattr(ui, 'pager'):
-        ui.pager(cmd)
-
 def memfilectx(repo, ctx, fctx, flags, copied, path):
     # XXX Would it be better at the module level?
     varnames = context.memfilectx.__init__.__code__.co_varnames
--- a/hgext3rd/evolve/evolvecmd.py	Thu Apr 19 16:25:17 2018 +0200
+++ b/hgext3rd/evolve/evolvecmd.py	Thu Apr 19 16:27:13 2018 +0200
@@ -1154,7 +1154,7 @@
                            for t in troublecategories
                            if opts[t]]
     if opts['list']:
-        compat.startpager(ui, 'evolve')
+        ui.pager('evolve')
         listtroubles(ui, repo, specifiedcategories, **opts)
         return
 
--- a/hgext3rd/evolve/obshistory.py	Thu Apr 19 16:25:17 2018 +0200
+++ b/hgext3rd/evolve/obshistory.py	Thu Apr 19 16:27:13 2018 +0200
@@ -83,7 +83,7 @@
 
     Returns 0 on success.
     """
-    compat.startpager(ui, 'obslog')
+    ui.pager('obslog')
     revs = list(revs) + opts['rev']
     if not revs:
         revs = ['.']
--- a/hgext3rd/topic/__init__.py	Thu Apr 19 16:25:17 2018 +0200
+++ b/hgext3rd/topic/__init__.py	Thu Apr 19 16:27:13 2018 +0200
@@ -600,7 +600,7 @@
                         " '_' and '.' characters")
             raise error.Abort(_("invalid topic name: '%s'") % topic, hint=helptxt)
 
-    compat.startpager(ui, 'topics')
+    ui.pager('topics')
 
     if list:
         if clear or rev:
@@ -681,7 +681,7 @@
         topic = repo.currenttopic
     if topic is None:
         branch = repo[None].branch()
-    compat.startpager(ui, 'stack')
+    ui.pager('stack')
     return stack.showstack(ui, repo, branch=branch, topic=topic, opts=opts)
 
 @command('debugcb|debugconvertbookmark', [
--- a/hgext3rd/topic/compat.py	Thu Apr 19 16:25:17 2018 +0200
+++ b/hgext3rd/topic/compat.py	Thu Apr 19 16:27:13 2018 +0200
@@ -24,10 +24,3 @@
     getmarkers = obsolete.getmarkers
 if successorssets is None:
     successorssets = obsolete.successorssets
-
-def startpager(ui, cmd):
-    """function to start a pager in case ui.pager() exists"""
-    try:
-        ui.pager(cmd)
-    except AttributeError:
-        pass