You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Christophe R <ch...@comcast.net> on 2012/05/07 06:23:59 UTC
svn commands and dos redirection
Hi,
Under Windows XP, with svn 1.6.17 (I also tried with 1.7.4) running
svn pl -R -v .
works as expected (I get a line "properties on <item>, followed by the
properties), for each item.
But when I redirect the same command to a file:
svn pl -R . >foo.txt
the output in the resulting file is out of order: the "propeties on '.'
" line shows up after 658 lines of properties! And it is followed by 100
lines "properties on". There are long blocks of properties without
"properties on" header.
adding the --xml option keeps the proper order, both on console and when
redirected.
This makes it difficult to write DOS scripts that handle svn output...I
have also tried using loops instead of redirection, but things still
show out of order:
FOR /F "usebackq tokens=* " %% IN in (`svn pl -R -v .>`) DO (ECHO %%G)
I also try piping, no luck, the following gives a messed up output too:
svn pl -R -v . | more
I ended up looping on each item, calling svn pl each time, but this is
painful (dealing with hidden items etc...)
svn pg seems to be working.
Is it just me? Or a defect? Any workaround (other than --xml or using
something more evolved than batch file)? Would there be other commands
affected?
Thanks
Christophe
Re: svn commands and dos redirection
Posted by chroyer <ch...@comcast.net>.
Thank you Daniel,
> From: "Daniel Shahaf" <d....@daniel.shahaf.name>
> See line 1063:1085 of
> https://svn.apache.org/repos/asf/subversion/trunk/subversion/svnlook/main.c
> for one possible explanation. If that is the case here, too, you would
> need to disable stdout buffering --- adding a flush() call to svn's
> code
> is the easiest way, but perhaps not the only way, to do that.
since I am not set up to make and test those changes, it seems that I should write this as a defect. I will read up on that!
Christophe
Re: svn commands and dos redirection
Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
See line 1063:1085 of
https://svn.apache.org/repos/asf/subversion/trunk/subversion/svnlook/main.c
for one possible explanation. If that is the case here, too, you would
need to disable stdout buffering --- adding a flush() call to svn's code
is the easiest way, but perhaps not the only way, to do that.
Christophe R wrote on Sun, May 06, 2012 at 21:23:59 -0700:
> Hi,
>
> Under Windows XP, with svn 1.6.17 (I also tried with 1.7.4) running
> svn pl -R -v .
> works as expected (I get a line "properties on <item>, followed by the
> properties), for each item.
>
> But when I redirect the same command to a file:
> svn pl -R . >foo.txt
> the output in the resulting file is out of order: the "propeties on '.'
> " line shows up after 658 lines of properties! And it is followed by 100
> lines "properties on". There are long blocks of properties without
> "properties on" header.
>
> adding the --xml option keeps the proper order, both on console and when
> redirected.
>
> This makes it difficult to write DOS scripts that handle svn output...I
> have also tried using loops instead of redirection, but things still
> show out of order:
> FOR /F "usebackq tokens=* " %% IN in (`svn pl -R -v .>`) DO (ECHO %%G)
> I also try piping, no luck, the following gives a messed up output too:
> svn pl -R -v . | more
>
> I ended up looping on each item, calling svn pl each time, but this is
> painful (dealing with hidden items etc...)
>
> svn pg seems to be working.
>
> Is it just me? Or a defect? Any workaround (other than --xml or using
> something more evolved than batch file)? Would there be other commands
> affected?
>
> Thanks
>
> Christophe