I am running the following command in linux to generate a verbose log for a particular revision.
svn log -v -r12345 http://svn-remote.com/path
The output is:
------------------------------------------------------------------------
r12345 | debajyoti.das@email.com | 2013-02-07 01:27:08 -0800 (Thu, 07 Feb 2013) | 1 line
Changed paths:
M /PROJECT/CYCLE/branches/DEV_Branch/cycle.agent/src/main/java/com/companyname/cycle/agent/Main.java
M /PROJECT/CYCLE/branches/DEV_Branch/cycle.agent/src/main/java/com/companyname/cycle/agent/bll/tasks/CycleGroupTask.java
M /PROJECT/CYCLE/branches/DEV_Branch/cycle.agent/src/main/java/com/companyname/cycle/agent/bll/tasks/CycleProcessTaskBll.java
M /PROJECT/CYCLE/branches/DEV_Branch/cycle.agent/src/main/java/com/companyname/cycle/agent/bll/tasks/CycleSequenceProcessTaskBll.java
M /PROJECT/CYCLE/branches/DEV_Branch/cycle.test/src/main/java/com/companyname/cycle/test/bll/MockCycleBll.java
M /PROJECT/CYCLE/branches/DEV_Branch/pas.cycle/src/main/java/com/companyname/pas/cycle/bll/DasCycleBll.java
M /PROJECT/CYCLE/branches/DEV_Branch/pas.cycle/src/main/java/com/companyname/pas/cycle/dal/DasCycleDal.java
BUG ID 12345678 - BLAH IMPLEMENTATION IN PROJECT.CYCLE
------------------------------------------------------------------------
I want to parse this log output the package names for each of those files. Eg:
PROJECT.CYCLE com.companyname.cycle.agent.bll.tasks CycleGroupTask.java
How to write the perl or python or a shell script to do that so that the usage can be like this for example:
$ perl svnlog.pl 12345 > log.txt
I think your java project is maven project:
test with your example:
This is a version that will run
svn log
and parse the output.Of course I don't have your repo so I had to fake the command and output by just
cat
ing your output but it works.My test output.
A maven repo would have a
src/test/java
directory too :D, I presume you're not interested in them.EDIT Running the body of the Perl against your data basically adding
my $cmd = "sh fake.sh";
from the other question produces:Which seems to be what the OP wants in the other question.
So the issue would be looping around the body of the Perl once for each
$revno
.EDIT changing the body of the code group by module to be...
produces this on the data previously given.
Which should go someway to helping the OP achieve what they want.