views:

21

answers:

2

I have some general purpose classes in one project that I would like to branch to another unrelated project in another TFS folder that I have mapped to a different workspace. I would prefer branching to plain copying to keep the change history and be able to merge back any changes.

However, when I try to branch the file in TFS, it complains that no appropriate mapping exists. Is there a way to branch across workspaces?

A: 

No, that's not possible - at least not that way.

But if you have general-purpose libraries, which are used across various applications, you should reorganize your project and workspace structure anyway...

If you had for example two solutions, which partially include the same project(s), and then would map each of these solutions to an individual workspace, then it should work.

HTH.
Thomas

Thomas Weller
The old classes come from a legacy .NET 2.0 project that I don't want to mess too much with. It would be a lot of work to generate a general purpose library when I only need a couple of classes.
Holstebroe
I have to object that it is not possible since I just did it (see the edit note in my question). It worked just as expected when I selected my SCE workspace to be the target workspace rather than the source workspace.
Holstebroe
I see, but isn't that a bit confusing or at least unintuitive? It's not obvious that parts of project A can undergo unrelated changes because they are also part of project B? It's quite easy to produce errors because of this, isn't it?
Thomas Weller
The parts of project A doesn't undergo changes unless the changes are explicitly merged back from project B. I don't see any problems here. I definitely see branching sub-parts of a project as less dirty than copying the code.
Holstebroe
You absolutely can do this. We do it on a daily basis. Branching, at its heart, doesn't care about workspaces.
Robaticus
Huh? TFS source control does exactly nothing without a workspace.
Thomas Weller
That's why I didn't say you don't need a workspace, I said that branching *at it's heart* doesn't *care about workspaces*. Yes, you need the workspace so that TFS knows which folders map to which server items, but you can map a workspace to `$/` and branch across team projects and branch across team projects.
Robaticus
A: 

It turned out that I just had to select my source control explorer workspace to be the target workspace rather than the source workspace, then branching was allowed. Now the files appear in the other project with history and possibility to merge back.

Holstebroe