tags:

views:

62

answers:

1

I am writing a batch file which is supposed to update the source files from tortoise and - if anything new was gotten - build the solution. Should be a very simple task.

My batchfile looks like this (I've removed the non-essentials)

set updatepath=%1
set solution=%2
set output=%3.txt

call TortoiseProc.exe /command:update /path:%updatepath% /closeonend:2    
call %devenv% %solution% /Build Debug /Out %output%

Now, I'd like to know if tortoise actually got new code for me and the not build if it didn't. How do I do this?

I am running Windows Vista

(The batch script is called from another batch script about 7 times - one for each project I need updated and - perhaps - build).

+1  A: 

Using tortoise is probably not the best way to resolve the problem.

To begin with, it would help knowing which SCM you're using (Mercurial, Subversion, CVS...). Most (all?) SCM tools come with a command-line interface, as opposed to the tortoise shell extension. If you used e.g. mercurial, this is how you would check if the local files need updating:

d:\projects\myproj> hg incoming <main repository path>

You could then parse the output to check if there are pending changes. A similar approach would work with other SCMs.

Tomislav Nakic-Alfirevic