Patchwork [2,of,2] pager: flush outputs before firing pager process

login
register
mail settings
Submitter Yuya Nishihara
Date March 18, 2017, 7:47 a.m.
Message ID <1a0bf99ca96b5f7fa28e.1489823252@mimosa>
Download mbox | patch
Permalink /patch/19433/
State Accepted
Headers show

Comments

Yuya Nishihara - March 18, 2017, 7:47 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1488011370 -32400
#      Sat Feb 25 17:29:30 2017 +0900
# Node ID 1a0bf99ca96b5f7fa28e9acb0fb21ea995499b81
# Parent  dc2eb4ca2186d50e036f20b11e52000ef11f67fe
pager: flush outputs before firing pager process

So that buffered outputs are always sent to the console.
Augie Fackler - March 19, 2017, 6:18 a.m.
On Sat, Mar 18, 2017 at 04:47:32PM +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1488011370 -32400
> #      Sat Feb 25 17:29:30 2017 +0900
> # Node ID 1a0bf99ca96b5f7fa28e9acb0fb21ea995499b81
> # Parent  dc2eb4ca2186d50e036f20b11e52000ef11f67fe
> pager: flush outputs before firing pager process

Queued, thanks

>
> So that buffered outputs are always sent to the console.
>
> diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py
> --- a/hgext/patchbomb.py
> +++ b/hgext/patchbomb.py
> @@ -715,7 +715,6 @@ def email(ui, repo, *revs, **opts):
>              m['Reply-To'] = ', '.join(replyto)
>          if opts.get('test'):
>              ui.status(_('displaying '), subj, ' ...\n')
> -            ui.flush()
>              ui.pager('email')
>              generator = emailmod.Generator.Generator(ui, mangle_from_=False)
>              try:
> diff --git a/mercurial/ui.py b/mercurial/ui.py
> --- a/mercurial/ui.py
> +++ b/mercurial/ui.py
> @@ -845,6 +845,7 @@ class ui(object):
>              return
>
>          self.debug('starting pager for command %r\n' % command)
> +        self.flush()
>          self.pageractive = True
>          # Preserve the formatted-ness of the UI. This is important
>          # because we mess with stdout, which might confuse
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py
--- a/hgext/patchbomb.py
+++ b/hgext/patchbomb.py
@@ -715,7 +715,6 @@  def email(ui, repo, *revs, **opts):
             m['Reply-To'] = ', '.join(replyto)
         if opts.get('test'):
             ui.status(_('displaying '), subj, ' ...\n')
-            ui.flush()
             ui.pager('email')
             generator = emailmod.Generator.Generator(ui, mangle_from_=False)
             try:
diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -845,6 +845,7 @@  class ui(object):
             return
 
         self.debug('starting pager for command %r\n' % command)
+        self.flush()
         self.pageractive = True
         # Preserve the formatted-ness of the UI. This is important
         # because we mess with stdout, which might confuse