[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [Subclipse-users] scope of revisionProperty from status in svn-ant task

From: Douglas Russell <douglas.russell_at_comlab.ox.ac.uk>
Date: 2006-10-19 16:05:48 CEST

Thanks, that explain it. It's really not that crazy when you stop to think
about it. :-)

On Wednesday 18 October 2006 23:23, Greg Irvine wrote:
> Hi Douglas.
>
>
>
> Disclaimer: I learned this from the ant user lists so I had exactly the
> same problem, so I haven't just made it up. :P
>
>
>
> This is an issue with ant property visibility. It has nothing to do with
> svnant.
>
>
>
> A property is usually only visible within the "target" it was created a-la
> a local variable.
>
> However, if multiple targets are used in the starting call to ant, then all
> properties created within those targets are visible to the other targets
> called.
>
>
>
> Given the ant script:
>
> <target name="build">
>
> <antcall target="second"/>
>
> <echo>${repos.version}</echo> <!-- will display blank! -->
>
> </target>
>
> <target name="update">
>
> <svn .... property="repos.version"/>
>
> </target>
>
>
>
> If you instigate ant with "ant build", then repos.version is ONLY visible
> in "second". "build" cannot access it even after making the antcall to
> "update".
>
>
>
> However, if you instigate ant with "ant update build", then repos.revision
> IS visible to "build".
>
>
>
> I had to change my starting scripts (in cruise control) to call "update
> unit_test" rather than just "unit_test" which used to call update itself.
>
>
>
> Hope it helps.
>
> Regards,
>
> Greg.
>
>
>
> Confidentiality Notice: This e-mail may contain confidential and/or
> privileged information and is intended solely for the addressee(s) named.
> If you have received this information in error, or are advised that you
> have been posted this e-mail by accident, please notify the sender by
> return e-mail, do not redistribute it, delete the e-mail and keep no
> copies.
>
>
>
>
>
> -----Original Message-----
> From: Douglas Russell [mailto:douglas.russell@comlab.ox.ac.uk]
> Sent: Thursday, 19 October 2006 3:35 AM
> To: users@subclipse.tigris.org
> Subject: [Subclipse-users] scope of revisionProperty from status in svn-ant
> task
>
>
>
> I wish to set an ant property with the number of the revision so I can
> later
>
>
> use it in a propset. Weirdly, the scope of the variable only seems to be
>
> _outside_ the <svn> element.
>
>
>
> <svn username="user1" password="user1password" javahl="true">
>
> <copy
> srcUrl="https://myserver/svn/repos/connectfour/trunk"
>
>
> destUrl="https://myserver/svn/repos/connectfour/branch-${branch-number}"
>
> message="Branch-${branch-number} created" />
>
>
>
> <checkout url=""https://myserver/svn/repos/connectfour/trunk"
>
> destPath="connectfour" />
>
>
>
> <status path="connectfour/README.txt"
> revisionProperty="status.revision" />
>
> <propset path="connectfour" name="subclipse:tags"
>
> value="${status.revision},connectfour-${branch-number},/connectfour-${branc
>h -number},branch" />
>
> ...
>
> </svn>
>
> <echo message="Status Revision: ${status.revision}" />
>
>
>
> Now, in the propset, the ${status.revision} is evaluated as an empty
> string,
>
>
> but once the echo is reached, the number is output. I then suspected this
>
> weird inverse scope problem and changed the script to:
>
>
>
> <svn username="user1" password="user1password" javahl="true">
>
> <copy
> srcUrl="https://myserver/svn/repos/connectfour/trunk"
>
>
> destUrl="https://myserver/svn/repos/connectfour/branch-${branch-number}"
>
> message="Branch-${branch-number} created" />
>
>
>
> <checkout url=""https://myserver/svn/repos/connectfour/trunk"
>
> destPath="connectfour" />
>
>
>
> <status path="connectfour" revisionProperty="status.revision" />
>
> </svn>
>
> <svn username="user1" password="user1password" javahl="true">
>
> <propset path="connectfour" name="subclipse:tags"
>
> value="${status.revision},connectfour-${branch-number},/connectfour-${branc
>h -number},branch" />
>
> ...
>
> </svn>
>
> <echo message="Status Revision: ${status.revision}" />
>
>
>
> and in that case, the variable in the second svn block in propset get read
>
> perfectly.
>
>
>
> That seems....odd, to say the least. Any ideas? This seems like a bug to
> me.
>
>
>
> CCing replies to me would be great, I promise, on my third svn ant problem
>
> I'll join the list. :-)
>
>
>
> Cheers.
>
>
>
> Douglas

-- 
Douglas PW Russell
Research Officer / Systems Administrator - GIMI
Research Officer / Systems Administrator - NeuroGrid
Oxford University Computing Laboratory
Tel:	+44 (0)1865 283519
email:	douglas.russell@comlab.ox.ac.uk

  • application/pgp-signature attachment: stored
Received on Thu Oct 19 16:06:07 2006

This is an archived mail posted to the Subclipse Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.