would you mind submitting this through jira as well?

On 06/06/2009, at 6:57 AM, Adam Monsen wrote:

Howdy,

I needed to fetch the part of an SCM url that provides a location like
"trunk" or "branches/issue_1820", so I modified
buildnumber-maven-plugin. Knowing the current branch (or tag) helps
distinguish builds since sometimes different SCM locations can have
the same revision number but have different content.

For instance, in Subversion it is possible to checkout
http://example.com/svn/trunk or
http://example.com/svn/branches/issue_1820 at revision "12798" and get
entirely different code.

This patch exposes the varible $buildScmBranch as a property,
similarly to how $buildNumber is currently exposed.

Problems with this patch:
* I probably didn't account for all error conditions properly
* only works with Subversion
* only works with "recommended" directory layout, ie: paths must
contain "/trunk", "/branches/X", or "/tags/X"
* I didn't do much documentation besides a little Javadoc and an
update of the "usage" page

This patch was created against SVN revision 9922 from a checkout
rooted at http://svn.codehaus.org/mojo/trunk/mojo/buildnumber-maven-plugin
.

Hope you find this useful too,
-Adam
<
buildScmBranch
.patch
>---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to