Getting Nant + nantcontrib. And write following script:
<target name="GetLastVersion">
<!--here get last version into $projectdir-->
</target>
<target name="VssAddFiles">
<fileset basedir="${projectdir}" id="ServerFiles">
<include name="**\*.*"/>
<exclude name="**\*.vspscc"/>
<exclude name="**\*.vssscc"/>
<exclude name="**\*.scc"/>
<exclude name="**\*.vss"/>
<exclude name="**\*.suo"/>
<exclude name="**\*.resharper.user"/>
<exclude name="**\*.resharper"/>
</fileset>
<foreach item="File" property="serverFile">
<in>
<items refid="ServerFiles"/>
</in>
<do>
<property name="localFile"
value="${string::replace(serverFile, projectdir, tempDir)}" />
<property name="currentFolder"
value="${path::get-directory-name(serverFile)}" />
<property name="vssPath"
value="${string::replace(string::replace(currentFolder, projectdir,
LocalVSSPath), '\', '/')}" />
<if test=
"${not file::exists(localFile)
and not string::contains(localFile, '\obj\')
and not string::contains(localFile, '\bin\')
and not string::contains(localFile, '\bin\')
and not string::contains(localFile, '\build\')
and not string::contains(localFile, '\MCControls\')
and not string::contains(localFile, 'ReSharper')}"><!--remove some artefacts-->
<echo message = "${vssPath}" />
<vssadd dbpath="\\server\vsstest\srcsafe.ini"
username="${UserName}" password="${UserPassword}" path="${vssPath}"
verbose="true">
<fileset basedir="${currentFolder}">
<include name="${path::get-file-name(serverFile)}"/>
</fileset>
</vssadd>
<echo message="${serverFile}"/>
</if>
</do>
</foreach>
</target>
<target name = "ChekinLatestVersion">
<call target ="GetLastVersion"/>
<!-- checkout into dummy directory-->
<vsscheckout
username="${UserName}"
password="${UserPassword}"
localpath="${tempDir}"
recursive="true"
writable="false"
dbpath="${LocalVSSPath}"
path="${VSSProjectDir}"
/>
<!-- checkin from project directory-->
<vsscheckin
username="${UserName}"
password="${UserPassword}"
localpath="${projectdir}"
recursive="true"
writable="false"
dbpath="${LocalVSSPath}"
path="${VSSProjectDir}"
comment="NAnt checkin"
/>
<call target ="VssAddFiles"/>
</target>
in GetLastVersion you can get from different vcs