You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Steve Hay <St...@planit.com> on 2008/07/04 15:34:15 UTC

svnlook diff output in wrong order when redirected

Hi,

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:

C:\Temp>svnlook diff C:\svnrepos -r 1427
Modified: raddev/trunk/issue/radan/radraft/fla/f_draw_dim.c
===================================================================
--- raddev/trunk/f_draw_dim.c   2008-07-03 10:33:28 UTC (rev 1426)
+++ raddev/trunk/f_draw_dim.c   2008-07-03 11:00:49 UTC (rev 1427)
@@ -1,5 +1,5 @@
[... diff here ...]

but this is not:

C:\Temp>svnlook diff C:\svnrepos -r 1427 >out.txt && type out.txt
--- raddev/trunk/f_draw_dim.c   2008-07-03 10:33:28 UTC (rev 1426)
+++ raddev/trunk/f_draw_dim.c   2008-07-03 11:00:49 UTC (rev 1427)
@@ -1,5 +1,5 @@
[... diff here ...]
Modified: raddev/trunk/issue/radan/radraft/fla/f_draw_dim.c
===================================================================

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.

Is this change by design or by accident?

Thanks,
Steve

(Note: Please Cc me in any replies since I'm not subscribed to this
list.)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


RE: svnlook diff output in wrong order when redirected

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Steve Hay wrote on Wed, 6 Aug 2008 at 09:16 +0100:
> Karl Fogel wrote:
> > Daniel Shahaf <d....@daniel.shahaf.co.il> writes:
> >> Because svn_cmdline_printf() uses the standard "FILE *stdout" to
> >> write to stdout, while svn_stream_for_stdout() uses (through
> >> apr_file_open_stdout()) Windows API's to get a handle for stdout?
> > 
> > Ah, could be.  Committed in r32019.
> > 
> > Thanks, Steve and Daniel (and Dang Nguyen, the original reporter).
> > 
> > -Karl
> 
> I've just upgraded to svn-1.5.1 (djh's svn-win32-1.5.1.zip in
> http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=8100,
> which reports itself as r32289--a later revision number than the above
> commit), and I find that this problem isn't fixed.
> 
> Did the fix go in this build or is it built from a branch that didn't
> get the fix?
> 

I've now proposed the fix for backport to 1.5.x.  It will probably be 
included in 1.5.2.  Thanks.

Daniel

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svnlook diff output in wrong order when redirected

Posted by Karl Fogel <kf...@red-bean.com>.
"Steve Hay" <St...@planit.com> writes:
> Karl Fogel wrote:
>> Ah, could be.  Committed in r32019.
>> 
>> Thanks, Steve and Daniel (and Dang Nguyen, the original reporter).
>> 
>> -Karl
>
> I've just upgraded to svn-1.5.1 (djh's svn-win32-1.5.1.zip in
> http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=8100,
> which reports itself as r32289--a later revision number than the above
> commit), and I find that this problem isn't fixed.
>
> Did the fix go in this build or is it built from a branch that didn't
> get the fix?

The latter.  However, this fix has been nominated for 1.5.2, the next
release from the 1.5.x line, and it is now one review+vote shy of being
merged.  So I think you'll probably see it in 1.5.2.

Best,
-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: svnlook diff output in wrong order when redirected

Posted by Steve Hay <St...@planit.com>.
Karl Fogel wrote:
> Daniel Shahaf <d....@daniel.shahaf.co.il> writes:
>> Because svn_cmdline_printf() uses the standard "FILE *stdout" to
>> write to stdout, while svn_stream_for_stdout() uses (through
>> apr_file_open_stdout()) Windows API's to get a handle for stdout?
> 
> Ah, could be.  Committed in r32019.
> 
> Thanks, Steve and Daniel (and Dang Nguyen, the original reporter).
> 
> -Karl

I've just upgraded to svn-1.5.1 (djh's svn-win32-1.5.1.zip in
http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=8100,
which reports itself as r32289--a later revision number than the above
commit), and I find that this problem isn't fixed.

Did the fix go in this build or is it built from a branch that didn't
get the fix?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: svnlook diff output in wrong order when redirected

Posted by Karl Fogel <kf...@red-bean.com>.
Daniel Shahaf <d....@daniel.shahaf.co.il> writes:
> Because svn_cmdline_printf() uses the standard "FILE *stdout" to write
> to stdout, while svn_stream_for_stdout() uses (through
> apr_file_open_stdout()) Windows API's to get a handle for stdout?

Ah, could be.  Committed in r32019.

Thanks, Steve and Daniel (and Dang Nguyen, the original reporter).

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svnlook diff output in wrong order when redirected

Posted by Daniel Shahaf <d....@daniel.shahaf.co.il>.
Karl Fogel wrote on Sat, 5 Jul 2008 at 18:37 -0400:
> Daniel Shahaf <d....@daniel.shahaf.co.il> writes:
> > Steve Hay wrote on Fri, 4 Jul 2008 at 17:27 +0100:
> >> Karl Fogel wrote:
> >> > By accident, certainly.  I'm not sure what exactly changed to cause
> >> > this, though.  Does the patch below have any effect for you?
> >> 
> >> Sorry, I'm not set up for building SVN. I've only ever used prebuilt
> >> binaries. I'm willing to give it a go if nobody else has time, but
> >> hopefully somebody else on Windows already has a suitable build
> >> environment set up and can try the patch more easily.
> >
> > Karl's patch fixes the problem for me.
> 
> Ugh.
> 
> I mean: that's great, but why on earth should that patch be necessary?
> Why isn't stdout buffering things in the right order to begin with?
> 

Because svn_cmdline_printf() uses the standard "FILE *stdout" to write
to stdout, while svn_stream_for_stdout() uses (through
apr_file_open_stdout()) Windows API's to get a handle for stdout?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svnlook diff output in wrong order when redirected

Posted by Karl Fogel <kf...@red-bean.com>.
Daniel Shahaf <d....@daniel.shahaf.co.il> writes:
> Steve Hay wrote on Fri, 4 Jul 2008 at 17:27 +0100:
>> Karl Fogel wrote:
>> > By accident, certainly.  I'm not sure what exactly changed to cause
>> > this, though.  Does the patch below have any effect for you?
>> 
>> Sorry, I'm not set up for building SVN. I've only ever used prebuilt
>> binaries. I'm willing to give it a go if nobody else has time, but
>> hopefully somebody else on Windows already has a suitable build
>> environment set up and can try the patch more easily.
>
> Karl's patch fixes the problem for me.

Ugh.

I mean: that's great, but why on earth should that patch be necessary?
Why isn't stdout buffering things in the right order to begin with?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: svnlook diff output in wrong order when redirected

Posted by Daniel Shahaf <d....@daniel.shahaf.co.il>.
Steve Hay wrote on Fri, 4 Jul 2008 at 17:27 +0100:
> Karl Fogel wrote:
> > By accident, certainly.  I'm not sure what exactly changed to cause
> > this, though.  Does the patch below have any effect for you?
> 
> Sorry, I'm not set up for building SVN. I've only ever used prebuilt
> binaries. I'm willing to give it a go if nobody else has time, but
> hopefully somebody else on Windows already has a suitable build
> environment set up and can try the patch more easily.

Karl's patch fixes the problem for me.

Daniel

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: svnlook diff output in wrong order when redirected

Posted by Steve Hay <St...@planit.com>.
Karl Fogel wrote:
> "Steve Hay" <St...@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?

Yes, exactly.  The "Modified: " and "=====[...]" lines are clearly
intended to be some kind of header above the diff, so it looks really
confusing when it comes out after them instead (especially when there is
another file following in the output...).

[...]
> 
>> 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?

Sorry, I'm not set up for building SVN. I've only ever used prebuilt
binaries. I'm willing to give it a go if nobody else has time, but
hopefully somebody else on Windows already has a suitable build
environment set up and can try the patch more easily.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: svnlook diff output in wrong order when redirected

Posted by Karl Fogel <kf...@red-bean.com>.
"Steve Hay" <St...@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@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svnlook diff output in wrong order when redirected

Posted by Daniel Shahaf <d....@daniel.shahaf.co.il>.
Steve Hay wrote on Fri, 4 Jul 2008 at 16:34 +0100:
> 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:
> 
> C:\Temp>svnlook diff C:\svnrepos -r 1427
> Modified: raddev/trunk/issue/radan/radraft/fla/f_draw_dim.c
> ===================================================================
> --- raddev/trunk/f_draw_dim.c   2008-07-03 10:33:28 UTC (rev 1426)
> +++ raddev/trunk/f_draw_dim.c   2008-07-03 11:00:49 UTC (rev 1427)
> @@ -1,5 +1,5 @@
> [... diff here ...]
> 
> but this is not:
> 
> C:\Temp>svnlook diff C:\svnrepos -r 1427 >out.txt && type out.txt
> --- raddev/trunk/f_draw_dim.c   2008-07-03 10:33:28 UTC (rev 1426)
> +++ raddev/trunk/f_draw_dim.c   2008-07-03 11:00:49 UTC (rev 1427)
> @@ -1,5 +1,5 @@
> [... diff here ...]
> Modified: raddev/trunk/issue/radan/radraft/fla/f_draw_dim.c
> ===================================================================
> 

I can reproduce this with 1.5 and trunk.  It's a regression from 1.4.

Patches welcome :)

> 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 CCed both of them.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org