Calling external code during commit

If you are having a problem using Vault, post a message here.
Post Reply
brianwelsch
Posts: 3
Joined: Thu Sep 27, 2012 1:59 pm

Calling external code during commit

Post by brianwelsch » Thu Sep 27, 2012 2:06 pm

I would like to automatically call code during the commit function that would read the source code being committed and update the Vault commit comment for that version. I was given the impression that it is possible to get hooks into this process on the server, but am not sure where to begin looking. Could someone point me in the right direction, or at least tell me whether it's possible or not?
TIA,
Brian Welsch

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Calling external code during commit

Post by lbauer » Thu Sep 27, 2012 5:00 pm

You could use the VaultPro Client API and write something that asks for the VersionHistory of just 1 row of $/ every couple of seconds. When the version changes, make modifications through the client API.

You can download the Client API from our Downloads page:
http://www.sourcegear.com/vault/downloads.html
Linda Bauer
SourceGear
Technical Support Manager

brianwelsch
Posts: 3
Joined: Thu Sep 27, 2012 1:59 pm

Re: Calling external code during commit

Post by brianwelsch » Fri Sep 28, 2012 10:02 am

Does this mean there isn't a way to trigger calling that process specifically on a commit?
I'm ignorant still on the actual database layout, but would the polling idea be able to check for Version changes on each file(easily tens of thousands of files) within the repository fairly quickly? If so, that may an acceptable way to go.

Thanks, Brian

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Calling external code during commit

Post by lbauer » Fri Sep 28, 2012 4:53 pm

Does this mean there isn't a way to trigger calling that process specifically on a commit?
No. Not at this time.

would the polling idea be able to check for Version changes on each file(easily tens of thousands of files) within the repository fairly quickly? If so, that may an acceptable way to go.
Possibly. But that would bypass security, and if not careful may interfere with Vault operations if the database locks something that it should not.

A more preferable way would be to run the history query on $/ to return just one version. When this changes, you can then query history for whatever version(s) you want, and gather what happened from that query.
Linda Bauer
SourceGear
Technical Support Manager

Post Reply