updateSources for agent vcs plugin

I'm working on TC integration with external VCS and I'm trying to allow agent to update only files affected with changes since last sources checkout if cleanCheckoutRequested parameter is set to false. Unfortunately to do so I need to know current version of source code on agent. How to do this?

3 comments
Comment actions Permalink

Hi Wojciech,

Do you mean you need a previous revision checked out into the directory during agent-side checkout? Usually, agent-side checkout does not need the information as VCS-specific tools are used to update the directory and they handle the case well enough. Could you please explain why do you need this in your case?

0
Comment actions Permalink

I need this information to do "update" operation on currently checkouted sources. I need this in case when user don't want to clear whole sources directory before new TC build.In this case I need to know what changes occured on sources between last checkout and NOW and apply diffs. Propably most VCSs put their own data like SVN its own .svn dir etc. Unfortunately I don't have such data so I have to find diffs manualy, thats why I need this information.

0
Comment actions Permalink

Wojciech,

I understand the case of incremental update but the recommended approach it to use native VCS client to perform the update which usually does not require any "from" version for the incremental update.

You also mention that
> what changes occured on sources between last checkout and NOW

Please note that is it not "NOW", but a specific version passed into the plugin code which you should update to.


If you do need the version, you can use AgentRunningBuild.getBuildPreviousVersion method. the build is passed to the plugin (e.g. in UpdateByCheckoutRules2.updateSources which plugin should implement).

0

Please sign in to leave a comment.