# HG changeset patch # User Pierre-Yves David # Date 1524148033 -7200 # Node ID 29c413a7dfb542e80aa0a8900718a3aa62d5aa04 # Parent 2577fdc3a4580e23f25d64e02807e3c50c99dc87 compat: drop compatibility layer for pager All versions we support now support `ui.pager`. diff -r 2577fdc3a458 -r 29c413a7dfb5 hgext3rd/evolve/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 diff -r 2577fdc3a458 -r 29c413a7dfb5 hgext3rd/evolve/evolvecmd.py --- 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 diff -r 2577fdc3a458 -r 29c413a7dfb5 hgext3rd/evolve/obshistory.py --- 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 = ['.'] diff -r 2577fdc3a458 -r 29c413a7dfb5 hgext3rd/topic/__init__.py --- 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', [ diff -r 2577fdc3a458 -r 29c413a7dfb5 hgext3rd/topic/compat.py --- 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