Three separate tasks:
- call
svn
properly to create the log - parse the log
- Write the parsed values somewhere
1.
import subprocess as sp
svn_url = "svn://repo-path.com/project"
revisions = [12345, 12346]
revision_clargs = ["-r%i" % revision for revision in revisions]
popen = sp.Popen(["svn", "log", "-v"] + revision_clargs + [svn_url],stdout=sp.PIPE,stderr=sp.PIPE)
out,err = popen.communicate()
2.
input_ = """
------------------------------------------------------------------------
r12345 | [email protected] | 2013-02-06 01:40:23 -0800 (Wed, 06 Feb 2013) | 1 line
Changed paths:
M /PROJECT/SHARED/branches/DEV_Branch/extensibility/src/main/java/com/companyname/extensibility/NamedExtensionPoint.java
M /PROJECT/SHARED/branches/DEV_Branch/extensibility/src/main/java/com/companyname/extensibility/PrePostExtensionPoint.java
M /PROJECT/SHARED/branches/DEV_Branch/extensibility/src/main/java/com/companyname/extensibility/helper/ExtensionConfigurationHelper.java
M /PROJECT/SRE/branches/DEV_Branch/ext/src/main/java/com/companyname/ext/DocumentGeneratorExt.java
M /PROJECT/SRE/branches/DEV_Branch/ext/src/main/java/com/companyname/ext/NamedExtensionPoint.java
M /PROJECT/SRE/branches/DEV_Branch/ext/src/main/java/com/companyname/ext/SystemDateBll.java
BUG 12345678 - BLAH IMPLEMENTATION
------------------------------------------------------------------------
r12346 | [email protected] | 2013-02-06 01:40:23 -0800 (Wed, 06 Feb 2013) | 1 line
Changed paths:
M /MODULE/CYCLE/branches/DEV_Branch/extensibility/src/main/java/com/companyname/extensibility/FileCycle1.java
M /MODULE/CYCLE/branches/DEV_Branch/extensibility/src/main/java/com/companyname/extensibility/FileCycle2.java
BUG 12345679 - BLAH IMPLEMENTATION
------------------------------------------------------------------------
"""
modified_prefix = " M "
projects = set(map(lambda x: ".".join(x.split("https://stackoverflow.com/")[1:3]),
filter(lambda x: x.startswith(modified_prefix),
(input_.split("\n")))))
3. Depends on what you want…
solved Finding the modules where changes were checked with svn