We copied TSVN source code into a git repo and then tried to build. It failed on the step where 'versioninfo.build' runs SubWCRev to try to construct a version number from the Subversion revision number.
It already bypasses this step and uses the result '0' (zero) if SubWCRev tool is not available. I changed it to also bypass this step if SubWCRev tool returns an error. (See diff below.)
I think it is useful to be able to move the source code to a different VCS and still work with it. This is one of only two issues with building outside an svn WC. (The other is the use of svn externals. I might send a separate message about how we are working around that.)
Would you be interested in having this change in the main code?
[[[
Allow the build to work in a non-svn checkout.
When calling 'SubWCRev' to generate version numbers, if this fails because
it's not an svn WC, fall back to just saying '0', the same as we already
did if SubWCRev program is not found.
diff --git a/versioninfo.build b/versioninfo.build
index 8746c586f..6aeb7a942 100644
--- a/versioninfo.build
+++ b/versioninfo.build
@@ -34,14 +34,14 @@
SubWCRev! So only use it if it exists and replace the WCREV with
0 if it doesn't -->
<if test="${file::exists(SubWCRevFileName)}">
- <exec program="${SubWCRevFileName}">
+ <exec program="${SubWCRevFileName}" failonerror="false" resultproperty="exitcode">
<arg value="." />
<arg value="
version.build.in" />
<arg value="version.build" />
<arg value="-f" />
</exec>
</if>
- <if test="${not file::exists(SubWCRevFileName)}">
+ <if test="${not file::exists(SubWCRevFileName) or property::get-value('exitcode')!='0'}">
<copy file="
version.build.in" tofile="version.build">
<filterchain>
<replacetokens begintoken="$" endtoken="$">
]]]
- Julian