Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using TFS TF History to determine the latest changeset

Tags:

tfs

tf-cli

I'm writing a script that will run a build only if there is a change in source code. I need to know whether there is a change since the build last ran. This used to work because the folder would not be deleted, so it was easy to determine whether there was a change, but now everything is deleted everytime the build is run. I thought about using the TFS TF history command to query the last changeset or the last two changesets, but have had issues parsing just the changeset number from the output. I also considered using the changeset command. Is there any command-line parameter that I can use to answer the question, has there been a change since either a date, or a changeset number?

like image 239
Joan Arc Avatar asked Apr 26 '12 17:04

Joan Arc


1 Answers

To the latest changeset number without local workspace, please use this command:

tf history /collection:"http://server:8080/tfs/Collection" "$/Project" /recursive /stopafter:1 /noprompt /login:domain\user,password
like image 191
Guanghui Qin Avatar answered Nov 05 '22 14:11

Guanghui Qin