Patchwork [06,of,19,pager] config: activate pager if not starting an editor

login
register
mail settings
Submitter Augie Fackler
Date Feb. 19, 2017, 11:12 p.m.
Message ID <22e4e9bdff5ebdd7feab.1487545977@imladris.local>
Download mbox | patch
Permalink /patch/18661/
State Accepted
Headers show

Comments

Augie Fackler - Feb. 19, 2017, 11:12 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1486440102 18000
#      Mon Feb 06 23:01:42 2017 -0500
# Node ID 22e4e9bdff5ebdd7feabb9ed7a1ff6b72c0fe7e8
# Parent  047682a5c9af676f0ac0e8169715f4e0b29f3dc0
config: activate pager if not starting an editor

This demonstrates the power of the non-attend-based pager API.

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1792,7 +1792,7 @@  def config(ui, repo, *values, **opts):
         ui.system("%s \"%s\"" % (editor, f),
                   onerr=error.Abort, errprefix=_("edit failed"))
         return
-
+    ui.pager('config')
     fm = ui.formatter('config', opts)
     for f in scmutil.rcpath():
         ui.debug('read config from: %s\n' % f)