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

Re: Bug: stdin can't be used on Windows, because of missing EOF

From: Liviu <lab2k1_at_gmail.com>
Date: Wed, 2 Jul 2008 20:33:33 -0500

From: "Neiss, Guenter" <GUENTER.NEISS_at_plarad.de>
>
> When running a hooks script, that get's some information via stdin
> (pre-revprop-change for ex.) this can't be used inside a simple BAT
> script.
>
> IMHO this comes, because stdin lacks an EOF.

It's not clear what part exactly is not working. FWIW the following works
with v1.4.6 under XP (cosmetic difference vs.
http://svn.haxx.se/users/archive-2006-03/0107.shtml is that it's using
'more' instead of 'find').

--------
@echo off

if /i not '%4'=='svn:log' (
  echo error: only svn:log revprop allowed >&2
  exit 1
)

for /f "tokens=*" %%x in ('more') do exit 0
echo error: empty propval >&2
exit 1
--------

You could of course replace the 'do' part with something more useful, right
now it simply returns success on the first non-empty line.

Cheers,
Liviu

P.S. If by any chance you meant EOL (not EOF) then it is true that partial
lines (not terminated with an EOL) are not piped through, but this happens
outside SVN itself. For example...

--------
C:\etc>more
this line gets through
this line gets through
this one doesn't^Z

C:\etc>
--------

---------------------------------------------------------------------
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-03 18:07:03 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.