开发者

TFS shelveset migration from one branch to another

I have to migrate the shelveset created in one branch say "development" to another say "release". so that I can directly merge the shelveset then to rele开发者_JAVA技巧ase which was created for development branch.

the command I have used is:

tfpt unshelve "shelveset name" /migrate /source:"$...development" /target:"$...Release"

it is showing this error:

unable to determine the workspace


Your location from where you launch the command must be from within your workspace. E.g. c:\workspaces\project\development if that's where your source is located.


I guess you question is: How can I get the job done without this error occurring?. In that case, make sure both branches are mapped to your local system and a latest version of your source code in you did a get-latest-version.

That should prevent the error from happening, because the paths then both contain information about the workspace used for the mapping.


I ran into the same issue today. After checking the items below I got it working:

  • Have only one Powertools installed.
  • Run the command from a Developer Command Prompt
  • Run the command from the folder that is mapped to your target workspace.

I had to uninstall v. 2010 so only v. 2012 remained. The version numbers doesn't seem to reference your TFS version.
To check if you are at the correct folder, you can run tf workspace.
In the window that pops up find the workspace that you want to target and check in column Local Folder. Make sure you are in that folder.


I spent good amount of time to get this done and I had few issues to overcome and one of these in fact was

unable to determine the workspace

This particular issue was solved by running the command from source branch root folder. This is contrary to some answers here and on SO in general where they say to use "target" branch - no, use "source":

cd [your !!source!! branch root]
tfpt unshelve /migrate /source:"$/MyCollection/Development/Maint1.1" /target:"$/MyCollection/Development/Maint1.2" "myShelveset;UserName"

Second issue appeared after this. Seem that it couldn't connect to TFS server. what I realized, I have multiple VS installed and connected to different TFS servers. I was using VS12 and I had workspace and server connection. But I didn't realize that same connection needs to be replicated in VS13 for TFPT2013 to work. It connects to same server and workspace.

I also tried doing it using TFPT2015 but I installed it and it didn't install TFPT.exe hence it was useless. So I tried from TFPT2013 to TFS2015 and it worked for this particular command. I wonder, why not, if VS12/13 works fine against TFS2015?

To summarize

  • Use CMD or DevCMD - doesn't matter
  • run from source branch root folder
  • verify Team Explorer Server connection
  • TF Power Tools 2013 work against TFS v15, at least migrate option works


My first answer explains how to have this done properly using TFPT. In this answer, I want to explain how to do it without TFPT.

Every developer should have multiple workspaces. Because we work on multiple issues simultaneously and we don't want to mix it up. so, you work on one issue in WS1 and another issue in WS2. So, if you unshelve your shelveset in a different workspace, this will do that as well. Because your shelveset can't point to 2 different locations in the same workspace. But in different workspace it will unshelve to a location mapped in that workspace.


I ran into the same problem as Boris Callens. I had installed the TF Power Tools for VS2012 and VS2013. When runing the tfpt.exe command in command promt I always had the error message "unable to determine the workspace". This is because I was using the VS 2012 power tools with TFS 2013. So I had to change the Path to the Power Tools in the System Environment Variable "TFSPowerToolDir" to point to the Power Tools for VS2013.

You can find the version number running: tfpt.exe /? TF Power Tools version

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜