As part of a bigger implementation, I'm trying to implement a merge operation of my source control branches/folders using TFS-SDK. I'm working against a TFS2010 installation.
What I have is this:
using System;
using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.VersionControl.Client;
using Microsoft.TeamFoundation.VersionControl.Common;
namespace MergeBranchesFolders
{
class Program
{
static void Main()
{
TfsTeamProjectCollection teamProjectCollection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri("http://TFSSERVER/Collection"));
var versionControl = teamProjectCollection.GetService<VersionControlServer>();
const string fromPath = "$/TeamProject/SourceDir";
const string toPath = "$/TeamProject/TargetDir";
Workspace myWorkspace = versionControl.GetWorkspace("WorkspaceName", "WorkspaceOwner");
GetStatus getStatus = myWorkspace.Merge(fromPath, toPath, VersionSpec.Latest, VersionSpec.Latest,
LockLevel.None, RecursionType.Full, MergeOptionsEx.None);
}
}
}
I'm convinced that I get proper access to myWorkspace
, yet the getStatus
looks like this:
That pretty much says that nothing has happened.
Yet if I try to merge in the IDE, I get several merge candidates.
The same merge candidates are also visible if I do a:
var mergeCandidates = versionControl.GetMergeCandidates(fromPath, toPath,RecursionType.Full).ToList();
I failed with both fromPath
/toPath
being branches and folders - even with single file.
The only resource out there I could find was this one, which didn't help...