views:

3229

answers:

3

Let's assume that some developer in my team shelved his changes that he did in branch A. And I am working on branch B. Can I unshelve his changes into branch B? (By GUI or command prompt)

A: 

The shelf information includes the specific path it goes to. Unfortunately I don't know of any automatic way to unshelve to any location other than the one it was shelved to. The times I've wanted to do this I had to check out the equivalent files in the new branch, unshelve from the old branch, then manually copy the files over.

EDIT: Well, I guess I was doing it the hard way. I'll have to try out Curt's solution. :)

Herms
+31  A: 

The power tools should let you do this.

C:\src\2\Merlin\Main>tfpt unshelve /?
tfpt unshelve - Unshelve into workspace with pending changes

Allows a shelveset to be unshelved into a workspace with pending changes.
Merges content between local and shelved changes. Allows migration of shelved
changes from one branch into another by rewriting server paths.

Usage: tfpt unshelve [shelvesetname[;username]] [/nobackup]
                     [/migrate /source:serverpath /target:serverpath]

 shelvesetname          The name of the shelveset to unshelve
 /nobackup              Skip the creation of a backup shelveset
 /migrate               Rewrite the server paths of the shelved items
                        (for example to unshelve into another branch)
 /source:serverpath     Source location for path rewrite (supply with /migrate)
 /target:serverpath     Target location for path rewrite (supply with /migrate)
 /nobackup              Skip the creation of a backup shelveset
Curt Hagenlocher
Ooohhh...Curt, I think you just made my day. I'm going to have to try that later.
Herms
Where do you get the power tools from?
Guy
Yep, the power tools SHOULD let you do this, but unfortunately the merge goes horribly wrong each time so it's next to useless.
apathetic
The merge isn't that bad. I found that Auto Merge works in 90% of the cases.
Justin Rudd
The power tools can be freely downloaded from some MSDN site. Use Google or Bing to find the right site -- that's what I need to do, too.
Curt Hagenlocher
Just tried it. I moved many files within the shelfset and unfortunately this doesn't seem to work well . You need to manually "migrate" all these files (there is also no multi-select). And then they are added as new files to the workspace. I can't use it, because I can't merge it anymore.
Stefan Steinegger
+1  A: 

Masterful. :) Um, 'auto merge'? Yeah, cause that's what I want to do, trust a tool to decide conflicts for me. :) If that's what you mean by 'the merge goes horribly wrong', it's time to spend a bit more than 30 seconds recovering your shelfsets. :)

Much better than copying the files over and having No Idea wtf the changes were. :)