SVN Tagging Workflow

panchalh
panchalh
Hi,    Basically what is needed is if a build is done yesterday with the files tagged with the version 9.0 the next day there will be changes made to the code in SVN. The changed files in the SVN need to be tagged with a new version number 9.1    I have made a workflow document feel free to change according to logic.    Please refer below details :          Tagging Workflow:  • Create working directory structure with all the folders located in the repository since it creates unique url for every folder in the repository  svn checkout [working directory path]  e.g. svn co https://svn.rice.edu/r/reponame ~/source/reponame    • Find the revision and redirect the output to an .xml file  svn log --stop-on-copy --xml http://server/repos/branches/mybranch  • Parse the .xml file and filter date and revision string from the file (place it in 2 variable)  // ParseSVN.groovy//// Given the XML output from this SVN command:// // $ svn log --stop-on-copy --xml //// Create a row per revision, suitable for something like a wiki//// if not enough args, cannot do anythingif (args.length < 1) { println "Usage: ParseSVN " return}svnXMLFile = args[0]// open up the SVN output so that we can just exit now if there is an errortry { svnXML = new XmlSlurper().parse(new File(svnXMLFile))}catch( ex ) { println "Unable to open: $svnXMLFile - ${ex.class.name} : ${ex.message}" return}// for each SVN entry create a rowentries = svnXML.logentry.findAll { it.@revision.text()}entries.each { revision = it.@revision.toString() author = it.author.toString() date = it.date.toString() msg = it.msg.toString() if (msg.size() > 80) { msg = msg.substring(0,79) msg += " ..." } msg = msg.replace('\n', ' ') tableRow = "||$revision||$author||$date||$msg||" println tableRow}  • OR USE  C:\Documents and Settings\jayraj.c\Desktop\Reusable Perl Scripts>perl filter.pl  + :date + :revision D:\Branch\test.xml  • Now there will be 2 variables (date) (revision)  • Join latest date with corresponding revision  • Checkout the above file with folder structure in the local machine  • Using complex tagging method, This will create tag from the files in the local machine  $ ls  my-working-copy/  $ svn copy my-working-copy \   http://svn.example.com/repos/calc/tags/mytag \   -m "Tag my existing working copy state."

Last updated

panchalh
panchalh
SVN Tagging Workflow    Hi,    Basically what is needed is if a build is done yesterday with the files tagged with the version 9.0 the next day there will be changes made to the code in SVN. The changed files in the SVN need to be tagged with a new version number 9.1    I have made a workflow document feel free to change according to logic.    more details :      Tagging Workflow:  • Create working directory structure with all the folders located in the repository since it creates unique url for every folder in the repository  svn checkout [working directory path]  e.g. svn co https://svn.rice.edu/r/reponame ~/source/reponame    • Find the revision and redirect the output to an .xml file  svn log --stop-on-copy --xml http://server/repos/branches/mybranch  • Parse the .xml file and filter date and revision string from the file (place it in 2 variable)  // ParseSVN.groovy//// Given the XML output from this SVN command:// // $ svn log --stop-on-copy --xml //// Create a row per revision, suitable for something like a wiki//// if not enough args, cannot do anythingif (args.length < 1) { println "Usage: ParseSVN " return}svnXMLFile = args[0]// open up the SVN output so that we can just exit now if there is an errortry { svnXML = new XmlSlurper().parse(new File(svnXMLFile))}catch( ex ) { println "Unable to open: $svnXMLFile - ${ex.class.name} : ${ex.message}" return}// for each SVN entry create a rowentries = svnXML.logentry.findAll { it.@revision.text()}entries.each { revision = it.@revision.toString() author = it.author.toString() date = it.date.toString() msg = it.msg.toString() if (msg.size() > 80) { msg = msg.substring(0,79) msg += " ..." } msg = msg.replace('\n', ' ') tableRow = "||$revision||$author||$date||$msg||" println tableRow}  • OR USE  C:\Documents and Settings\jayraj.c\Desktop\Reusable Perl Scripts>perl filter.pl  + :date + :revision D:\Branch\test.xml  • Now there will be 2 variables (date) (revision)  • Join latest date with corresponding revision  • Checkout the above file with folder structure in the local machine  • Using complex tagging method, This will create tag from the files in the local machine  $ ls  my-working-copy/  $ svn copy my-working-copy \   http://svn.example.com/repos/calc/tags/mytag \   -m "Tag my existing working copy state."
thulasiram
thulasiram
Hi.. need your help.    I need to a create a tag for the modified files from 'last build revision' to 'latest revision'.That means, I need to create a tag before build.    I didn't understand the script which you published. can u send in detailed manner.      Thanks in advance.

1-3 of 3

Reply to this discussion

You cannot edit posts or make replies: You should be logged in before you can post.