[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Flush stdout more often

From: Stefan Haller <haller_at_ableton.com>
Date: 2006-02-10 18:27:10 CET

Peter N. Lundblad <peter@famlundblad.se> wrote:

> > Should I prepare a patch?
>
> Please:-)

Here it is. It's my first patch for subversion, so please bear with me
if I did something stupid.

-- 
Stefan Haller
Ableton
http://www.ableton.com/
[[[
Flush stdout after every line that is printed (for most commands, except
for diff and blame).  This is useful when piping svn output into
post-processor tools, e.g. to colorize the output, or simply into tee.
* subversion/svn/diff-cmd.c
  (summarize_func): Flush output after every line printed.
* subversion/svn/status.c
  (print_status): Flush output after every line printed.
* subversion/svn/notify.c
  (notify): Flush output after every line printed.
]]]
Index: ../trunk/subversion/svn/diff-cmd.c
===================================================================
--- ../trunk/subversion/svn/diff-cmd.c  (revision 18413)
+++ ../trunk/subversion/svn/diff-cmd.c  (working copy)
@@ -84,6 +84,8 @@
                                summary->copyfrom_path ? '+' : ' ',
                                path));
 
+  SVN_ERR (svn_cmdline_fflush(stdout));
+
   return SVN_NO_ERROR;
 }
 
Index: ../trunk/subversion/svn/status.c
===================================================================
--- ../trunk/subversion/svn/status.c    (revision 18413)
+++ ../trunk/subversion/svn/status.c    (working copy)
@@ -191,6 +191,8 @@
                             ? 'K' : ' '),
                            path));
 
+  SVN_ERR (svn_cmdline_fflush(stdout));
+
   return SVN_NO_ERROR;
 }
 
Index: ../trunk/subversion/svn/notify.c
===================================================================
--- ../trunk/subversion/svn/notify.c    (revision 18413)
+++ ../trunk/subversion/svn/notify.c    (working copy)
@@ -368,6 +368,9 @@
       break;
     }
 
+  if ((err = svn_cmdline_fflush(stdout)))
+    goto print_error;
+
   return;
 
  print_error:
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Feb 10 18:38:55 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.