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

Re: SVN scripting

From: David Weintraub <qazwart_at_gmail.com>
Date: 2005-07-18 21:35:28 CEST

Hmmm DOS...

Okay. Instead of using /bin/false as the parameter for the --diff-cmd,
create a one-line batch script with "exit /b 2" as the sole command.
Then pass this batch script as the parameter to your --diff-cmd. That
will prevent the file differences from being outputted in the "svn
diff" command.

Also, you can use the DOS "find" command that seems to work somewhat
like awk and grep:

$ svn diff --diff-cmd false.bat -r $start:$end $url | find "Index: "

Of course, the best thing to do is to download ActiveState Perl
(http://activestate.com/Products/ActivePerl/?psbx=1) or Cygwin
(http://cygwin.com/) and use a real scripting language. Perl is more
universal and more powerful scripting language, but you need
administrative rights to load it on your machine. Cygwin doesn't need
administrative priveledges, and you also get a lot of other very
powerful tools with it.

And for both Cygwin and Perl, like Subversion, the price is right.

On 7/18/05, Andy Peters <devel@latke.net> wrote:
> David Weintraub wrote:
>
>
> > On 7/17/05, Calvin <szguoxz@hotmail.com> wrote:
> >
> >>I am new to SVN, got a question to script SVN.
> >>
> >>I need a list of files that has been changed between 2 revisions, say 3:10.
> >>
> >>I kindof like the svn diff to produce a list of files, which should be
> >>easier to parse using nant or something. But svn diff produce a list files
> >>hard to parse, and with content change to it.
> >>
> >>I am sure there should be such a command somewhere, who has it? :-)
> >
> > You can just get a listing of the changed files by doing this:
> >
> > $ svn diff -r $start:$end $url | grep "^Index: "
> >
> > Or to remove the Index at the front of the line, use "awk"
> >
> > $ svn diff -r $start:$end $url | awk -F: '/^Index: / {print $2}'
> >
> > You could also try substituting your own diff command to see what you
> > get. Maybe just "echo" or "print"? You'll still get the "Index: "
> > lines, but you can eliminate all of the textual differences that way
> > too.
>
> He's running Windows, so unless he's downloaded and installed either
> Cygwin or the Unixutils, your excellent suggestions aren't much help to him!
>
> -a
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>

-- 
--
David Weintraub
qazwart@gmail.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Jul 18 21:37:41 2005

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.