Search code examples
visual-studio-2010tfsbranching-and-mergingbaseless-merge

Baseless merge for multiple non-consecutive changesets


I'm issuing the following command to TFS:

>tf merge /baseless c:\ws\source c:\ws\target /recursive /version:C100~C100

But I have a large list of changesets that need to be merged. Is there a shortcut for this, or some way to specify a list, for example:

>tf merge /baseless c:\ws\source c:\ws\target /recursive /version:C100,C108,C110,C800,C1001,etc...

Solution

  • If powershell is an option, below script should help (not tested!):

    $cslist = 1,23,45,456,568 #list of all changesets
    foreach ($cs in $cslist) { & 'C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe' merge /baseless c:\ws\source c:\ws\target /recursive /version:C$cs }