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

Re: use-commit-times = effectless?

From: Jan Hendrik Niemeyer <jhniemeyer_at_marine-niemeyer.com>
Date: 2003-12-15 17:39:43 CET

Concerning Re: use-commit-times = effectless?
Dominic Anello wrote on 12 Dec 2003, 16:01, at least in part:

[text is snipped]

> I can vouch for the start syntax working. I've been using it for a
> couple of weeks to do both incremental dumps and deltification for our
> repository. The dumps are definitely getting created just fine, and I
> haven't noticed excessive database growth, so I assume deltification
> is working. The start command always seems to return a zero error
> code, so you can't really check the result of the svnadmin call within
> the post-commit script. I suppose you couold write a wrapper batch
> file that post-commit calls that will log the error code somewhere.
>
> I've attached my post-commit script if it will help.

I have played around a little and finally got the wanted
confirmation.Twice to be exact. Appending ">> %err%" to the
deltafication command redirects screen output of svnadmin deltify
to the error log you already had defined. With %log% it worked,
too, but the rest of the script is no longer written to post-
commit.log. Therefore the second log file is needed.

But moving the echo lines behind the actual command and
separate them by "&&" will write them only in case the command
was executed successfully. So the logfile should now say what
really happened, not what commands were executed.

The block for removing the logfiles seems to work, however, my
playground was too small to test this out. See post-commit.bat
included once more.

Thanks again for getting me started!

Jan Hendrik
---------------------------------------
Freedom quote:

     There is no worse tyranny than to force a man to pay for
     what he does not want merely because you think it would be good for him.
               -- Robert Heinlein

@echo off

set repo=%1
set rev=%2
set log="%repo%\hooks\log\post-commit.log"
set err="%repo%\hooks\log\post-commit-err.log"
set dump_file="%repo%\hooks\dump\incremental-r%rev%.dump"
set svnadmin="F:\PRG\Tools\Subversion\bin\svnadmin.exe"

( echo ========================================================================
echo Start commit %repo% r%rev%
date /t
time /t ) >> %log%

( echo ========================================================================
echo Start deltify %repo% r%rev%
date /t
time /t ) >> %err%

set delta_cmd=start "deltify %repo% r%rev%" /B /BELOWNORMAL %svnadmin% deltify -r %rev% %repo%
rem echo "%delta_cmd%">>%log%
(%delta_cmd% >> %err%) && echo "deltified revision %rev%" >> %log%

set dump_cmd=start "dump %repo% r%rev%" /B /BELOWNORMAL %svnadmin% dump %repo% -r %rev% --incremental
rem echo "%dump_cmd%">>%log%
(%dump_cmd% > %dump_file%) && echo "incrementally dumped revision %rev% to %dump_file%" >> %log%

set dblogs_cmd=start "remove unused logfiles of %repo%" /B /BELOWNORMAL %svnadmin% list-unused-dblogs %repo%
rem echo "%dblogs_cmd%">>%log%
(%dblogs_cmd% | xargs rm) && echo "successfully removed unused logfiles from %repo%" >> %log%

( echo End commit.
date /t
time /t ) >> %log%

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Dec 15 18:23:07 2003

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

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