On Nov 11, 2005, at 03:45, Ryan Schmidt wrote:
>> What I'd like to be able to do is use the script to copy the state
>> of the transaction out to a directory and run the build script.
>> If it builds then I want the transaction committed. If not I want
>> it to abort and the user to be notified.
>>
>> Obviously this means we'd have to wait around for the build to
>> finish, but in our situation that would only mean a few minutes.
>> The benefit would is that we wouldn't ever have a case where it
>> works on the developer's machine but not on the integration server.
>
> If you really want to, and your developers will tolerate the delay,
> then sure, it's possible. You can use "svnlook changed" in the pre-
> commit hook to figure out what files the transaction wants to
> change. You could have an up-to-date working copy waiting, and you
> could then "svnlook cat" the changed files into the working copy
> and do the build. You'll have to devise a mechanism to clean up
> after the build when you're done, and to remove the effects of the
> "cat" commands, for example by doing "svn revert" on the working
> copy, then using the output of "svn statuts" to see what
> unversioned files remain, and deleting them.
Oh, I should add that there's also "svnlook diff"; it would probably
be much easier to get the diff and apply it to the working copy than
to script something that works with "svnlook changed" and "svnlook
cat". I must admit though that I'm not entirely sure how to use
"svnlook diff" to do this, since usually you get a diff between two
paths, or between two revisions of one path, but in this case you'd
need the difference between HEAD and the transaction. But I think
"svnlook diff" is still where I'd look first.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Nov 11 09:58:41 2005