[ 
https://issues.jenkins-ci.org/browse/JENKINS-4838?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=162169#comment-162169
 ] 

GlennZ edited comment on JENKINS-4838 at 4/27/12 8:47 PM:
----------------------------------------------------------

Any activity on this?  We use hg subrepos, and I've got a partial work-around 
that allows us to include the subrepo changes on the jenkins "Changes" screens, 
but it doesn't work for the email notifications:

Our build script runs a similar "hg incoming" command to the one that the 
jenkins mercurial plug-in already runs for the top level hg repo, and it 
modifies/augments the jenkins changelog.xml file in the builds directory with 
the additional changes for each subrepo.

Here's a partial snippet from that script:
{quote}
{noformat}
TEMPLATE="<changeset node='{node}' author='{author|xmlescape}' rev='{rev}' 
date='{date}'><msg>{desc|xmlescape}</msg><added>{file_adds|stringify|xmlescape}</added><deleted>{file_dels|stringify|xmlescape}</deleted><files>{files|stringify|xmlescape}</files><parents>{parents}</parents></changeset>\n"
 

{
    grep -v '</changesets>' $CHANGELOG

    # Run the hg incoming report to pick up the changes for each project.
    # (The main/parent project changelog is already captured by jenkins.)
    for PROJECT in $@; do
       hg -R $PROJECT incoming --quiet --template "$TEMPLATE"
    done

    echo "</changesets>"
} > $CHANGELOG.new  && mv $CHANGELOG.new $CHANGELOG
{noformat}
{quote}

Note that the above "hg in" will include all changesets up to tip since the 
last build.  To more generally support the .hgsubstate file, the "hg in" should 
include "-r $rev", where $rev is set from the entry in .hgsubstate.

The build script then proceeds to update the workspace with the incoming 
subrepo changesets and complete the build.  The final kludge to get jenkins to 
see the modified changelog.xml file is to trigger a jenkins reload.

It would be better to get this functionality into the mercurial plugin and 
avoid needing to do that kludge, which would likely also allow the added 
changes to be included with the build notification emails.  I haven't yet 
delved into jenkins plug-in module development but might look into it for this.
                
      was (Author: gzilla):
    Any activity on this?  We use hg subrepos, and I've got a partial 
work-around that allows us to include the subrepo changes on the jenkins 
"Changes" screens, but it doesn't work for the email notifications:

Our build script runs a similar "hg incoming" command to the one that the 
jenkins mercurial plug-in already runs for the top level hg repo, and it 
modifies/augments the jenkins changelog.xml file in the builds directory with 
the additional changes for each subrepo.

Here's a partial snippet from that script:
{quote}
{noformat}
TEMPLATE="<changeset node='{node}' author='{author|xmlescape}' rev='{rev}' 
date='{date}'><msg>{desc|xmlescape}</msg><added>{file_adds|stringify|xmlescape}</added><deleted>{file_dels|stringify|xmlescape}</deleted><files>{files|stringify|xmlescape}</files><parents>{parents}</parents></changeset>\n"
 

{
    grep -v '</changesets>' $CHANGELOG

    # Run the hg incoming report to pick up the changes for each project.
    # (The main/parent project changelog is already captured by jenkins.)
    for PROJECT in $@; do
       hg -R $PROJECT incoming --quiet --template "$TEMPLATE"
    done

    echo "</changesets>"
} > $CHANGELOG.new  && mv $CHANGELOG.new $CHANGELOG
{noformat}
{quote}

The script then proceeds to update the workspace with the incoming subrepo 
changesets and complete the build.  The final kludge to get jenkins to see the 
modified changelog.xml file is to trigger a jenkins reload.

It would be better to get this functionality into the mercurial plugin and 
avoid needing to do that kludge, which would likely also allow the added 
changes to be included with the build notification emails.  I haven't yet 
delved into jenkins plug-in module development but might look into it for this.
                  
> Subrepo support
> ---------------
>
>                 Key: JENKINS-4838
>                 URL: https://issues.jenkins-ci.org/browse/JENKINS-4838
>             Project: Jenkins
>          Issue Type: New Feature
>          Components: mercurial
>    Affects Versions: current
>         Environment: Platform: All, OS: All
>            Reporter: jglick
>            Assignee: jglick
>
> In addition to supporting the Forest extension, it would be good to support 
> the
> new subrepo system in Hg 1.3+.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.jenkins-ci.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to