Search code examples
msbuildgetchangeset

MSBuild for speficic changesets- more than one changeset !


We are using MsBuild on TFS 2008 for building our solutions.

I need your advice and help about below scenario.

For example :

We prepared a full build for one of our customers.

After package is get ready, 2 developers want to add their development to the package.

I am trying to find a solution to add only the 2 developers code checkins to new build.

I mean i need to specify changeset numbers for MsBuild as parameter.

for example, i only want to start a build for changeset number 200,400 and 434. 3 of them must be included the getting source process.

İ found a solution like /p:GetVersion:C1800

http://blogs.msdn.com/b/granth/archive/2008/06/26/how-to-make-team-build-get-a-previous-version.aspx

but this gets only one changeset. i need to specify more than one changeset number.

Or my approach can be totaly wrong, do you have any suggestions, guidance?

Thanks a lot,

Fatih.


Solution

  • If TFS Get command gets all the changesets up to your specified changeset. So if you want to include 200, 400 and 434, you only need to specify 434 as the changeset you want to get at. Note that this will also get all other changesets that are newer your workspace's version and older than 434.

    I don't think TFS allows you to get just a specific changeset, unless you also specify the items you want to get. What I meant is, if changeset 123 includes files A, B, and C, and you just want to get this 123 changeset (and nothing else), you need to do something like

    "tf get A;123"

    "tf get B;123"

    "tf get C;123"

    You can find more information about the Get command here.

    UPDATE:

    Just found out that the tfpt tool can get a specific changeset:

    Usage: tfpt getcs /changeset:changesetnum [/force] [/overwrite]

    Gets only the files in a particular changeset at the version of the changeset.

    /changeset Specifies the number of the changeset to get. /force Same as tf get /force /overwrite Same as tf get /overwrite