You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Calvin <sz...@hotmail.com> on 2005/07/18 00:16:34 UTC

SVN scripting

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? :-)

Thanks,

Calvin


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

Re: SVN scripting

Posted by kf...@collab.net.
Calvin, your post appeared in an unrelated thread.  Please read:

   http://subversion.tigris.org/mailing-list-guidelines.html#fresh-post

Thank you.

-Karl

"Calvin" <sz...@hotmail.com> writes:
> 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? :-)
> 
> Thanks,
> 
> Calvin
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org

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

Re: SVN scripting

Posted by David Weintraub <qa...@gmail.com>.
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 <de...@latke.net> wrote:
> David Weintraub wrote:
> 
> 
> > On 7/17/05, Calvin <sz...@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


Re: SVN scripting

Posted by Andy Peters <de...@latke.net>.
David Weintraub wrote:


> On 7/17/05, Calvin <sz...@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

Re: SVN scripting

Posted by David Weintraub <qa...@gmail.com>.
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.

I was thinking that maybe the output of the "update" command could be
helpful. For example, you checkout revision 10, then do an update to
revision 25 and see what the update command prints out.

On 7/17/05, Calvin <sz...@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? :-)
> 
> Thanks,
> 
> Calvin
> 
> 
> ---------------------------------------------------------------------
> 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


Re: svn diff

Posted by Russ Brown <pi...@gmail.com>.
Calvin wrote:
> Is there a way to show only the file names with diff?
> 
> Now we got the content in the output, which really is useless to me, and
> make this command too slow.
> 
> Looks like svnlook can do such a job, but it's running on the server side.
> 

Won't svn log -v do something more like what you're after? Just pipe it
into grep for the lines you want. Should be a lot quicker than using diff.

> Thanks,
> 
> Calvin
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
> 
> 


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

svn diff

Posted by Calvin <sz...@hotmail.com>.
Is there a way to show only the file names with diff?

Now we got the content in the output, which really is useless to me, and
make this command too slow.

Looks like svnlook can do such a job, but it's running on the server side.

Thanks,

Calvin


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