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

Re: svnlook diff output in wrong order when redirected

From: Karl Fogel <kfogel_at_red-bean.com>
Date: Fri, 04 Jul 2008 12:19:18 -0400

"Steve Hay" <SteveHay_at_planit.com> writes:
> I've just installed Subversion 1.5.0 on Windows XP and I find that the
> output of "svnlook diff ..." comes out in the wrong order when
> redirected, e.g. this is OK:

So the issue is that the "Modified: " line comes before the diff in the
first instance, but after the diff in the second?

> [...]
>
> Somebody already reported this on the users@ list but got no reply:
>
> http://subversion.tigris.org/servlets/ReadMsg?listName=users&msgNo=79302
>
> and someone else has reported it in connection with VisualSVN:
>
> http://groups.google.co.uk/group/visualsvn/browse_thread/thread/96fff4e4
> 815ffebd/41f0f3b481035ba9?hl=en&lnk=st&q=svnlook+output+in+wrong+order#4
> 1f0f3b481035ba9
>
> I'm finding that it makes the emails produced by my post commit hook
> script look rather confused.

Yep. Unfortunately, I can't reproduce this, at least under Debian
GNU/Linux. Here's what I tried:

$ svnlook diff -r31990 svnsynced_copy_of_svn_repos
Modified: trunk/contrib/client-side/emacs/psvn.el
===================================================================
--- trunk/contrib/client-side/emacs/psvn.el 2008-07-03 15:42:09 UTC (rev 31989)
+++ trunk/contrib/client-side/emacs/psvn.el 2008-07-03 16:55:39 UTC (rev 31990)
@@ -4023,7 +4023,7 @@
       (message "Running svn-update for %s" default-directory)
       (svn-run t t 'update "update"
                (when rev (list "-r" rev))
- (list "--non-interactive") default-directory))))
+ (list "--non-interactive") (expand-file-name default-directory)))))
 
 (defun svn-status-commit ()
   "Commit selected files.

$ svnlook diff -r31990 svnsynced_copy_of_svn_repos > foo
$ cat foo
Modified: trunk/contrib/client-side/emacs/psvn.el
===================================================================
--- trunk/contrib/client-side/emacs/psvn.el 2008-07-03 15:42:09 UTC (rev 31989)
+++ trunk/contrib/client-side/emacs/psvn.el 2008-07-03 16:55:39 UTC (rev 31990)
@@ -4023,7 +4023,7 @@
       (message "Running svn-update for %s" default-directory)
       (svn-run t t 'update "update"
                (when rev (list "-r" rev))
- (list "--non-interactive") default-directory))))
+ (list "--non-interactive") (expand-file-name default-directory)))))
 
 (defun svn-status-commit ()
   "Commit selected files.

$

> Is this change by design or by accident?

By accident, certainly. I'm not sure what exactly changed to cause
this, though. Does the patch below have any effect for you?

[[[
* subversion/svnlook/main.c
  (print_diff_tree): Flush the diff header before even creating the
    stdout stream to which diff information will be emitted.

This shouldn't be necessary. I just want to see if it has any effect on
http://subversion.tigris.org/servlets/ReadMsg?listName=users&msgNo=79302
or http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=140782.
]]]

Index: subversion/svnlook/main.c
===================================================================
--- subversion/svnlook/main.c (revision 31998)
+++ subversion/svnlook/main.c (working copy)
@@ -979,6 +979,7 @@
 
               /* Print diff header. */
               SVN_ERR(svn_cmdline_printf(pool, header->data));
+ SVN_ERR(svn_cmdline_fflush(stdout));
               SVN_ERR(svn_stream_for_stdout(&ostream, pool));
 
               if (orig_empty)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-07-04 18:20:16 CEST

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.