Patchwork [1,of,2,pager-tweaks] incoming: delay pager activation until right before printing changes

login
register
mail settings
Submitter Augie Fackler
Date Feb. 21, 2017, 7 p.m.
Message ID <54759a9a01b70dc90fe8.1487703607@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/18692/
State Accepted
Headers show

Comments

Augie Fackler - Feb. 21, 2017, 7 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1487692393 18000
#      Tue Feb 21 10:53:13 2017 -0500
# Node ID 54759a9a01b70dc90fe8db95023f18244b50a7c4
# Parent  59e69ed81776f0186cb6e6c69f8d7659afab26b7
incoming: delay pager activation until right before printing changes

This prevents authentication and other brief status messages from
being paged.
Yuya Nishihara - Feb. 22, 2017, 2 p.m.
On Tue, 21 Feb 2017 14:00:07 -0500, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler <augie@google.com>
> # Date 1487692393 18000
> #      Tue Feb 21 10:53:13 2017 -0500
> # Node ID 54759a9a01b70dc90fe8db95023f18244b50a7c4
> # Parent  59e69ed81776f0186cb6e6c69f8d7659afab26b7
> incoming: delay pager activation until right before printing changes

These look good. Queued, thanks!

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -3210,7 +3210,6 @@  def incoming(ui, repo, source="default",
             cmdutil.displaygraph(ui, repo, revdag, displayer,
                                  graphmod.asciiedges)
 
-        ui.pager('incoming')
         hg._incoming(display, lambda: 1, ui, repo, source, opts, buffered=True)
         return 0
 
@@ -3230,7 +3229,6 @@  def incoming(ui, repo, source="default",
 
     repo._subtoppath = ui.expandpath(source)
     try:
-        ui.pager('incoming')
         return hg.incoming(ui, repo, source, opts)
     finally:
         del repo._subtoppath
diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -804,7 +804,7 @@  def _incoming(displaychlist, subreporecu
         if not chlist:
             ui.status(_("no changes found\n"))
             return subreporecurse()
-
+        ui.pager('incoming')
         displayer = cmdutil.show_changeset(ui, other, opts, buffered)
         displaychlist(other, chlist, displayer)
         displayer.close()