28
votes

Since they have supposedly integrated most of the Power Tools functionality into VS2017, the new command "tf unshelve" does not work the same as the old command "tfpt unshelve" to move shelvesets to another branch, as you cannot add a source and a target using the new command. I really don't want to have to install VS2015 on my laptop just to move a shelveset. Does anyone know how to do this with VS2017? I'm having a hard time believing this is no longer possible.

Any assistance is greatly appreciated!

8

8 Answers

28
votes

I absolutely agree this is a greatly missed feature in 2017 and up. After too many times of doing this manually, I decided to add it to my (free) Visual Studio Extension called 'MultiMerge'. You can now right-click a shelveset and choose your target branch. There's a VS2017 version and VS2019. Or you can simply choose this extension using Tools and Extentions menu in Visual Studio.

Feel free to rate the extension, and let others find it more quickly:)

9
votes

Another WORKAROUND...

  1. Check in the changes from existing shelveset (Changeset 1)
  2. Merge the changes to the other branch and check in (Changeset 2)
  3. Rollback the changes from Changeset 1.

This keeps changes from changeset 2 and rolls back the original branch.

This process may not work for every company and their policies but it does work. I don't like it but sometimes it is necessary.

6
votes

Unfortunately move Shelveset to Another Branch with the command "tftp unshelve" or "tf unshelve" is still not supported for now in VS 2017.

There's already a feedback submitted here to track that, just as Youhana Naseim [MSFT] mentioned below (source here) :

For VS 2017 we do not have a power tools release. We are constantly evaluating the features that are still missing in the product. The three most notable ones are:

  • TFS Windows Shell Extensions integration

  • Find by Status for server workspaces

  • Unshelve /migrate

So as a workaround, you can try below ways:

4
votes

Another probably easier way working with VS2019 is to copy/paste your source folder to the branch target folder and use

tf reconcile /promote

to detect all added or changed files.

2
votes

Here's how I do it when I know the branch files can be overwritten directly by the shelf-set. If you need to merge, then use win-merge with directory compare to stitch things back together.

  • Close all instances of Visual Studio
  • Rename your local source directory to a temporary name
  • Open Visual Studio
  • Unshelve your changes normally - VS will recreate the directory structure with just your changes in it.
  • Copy all your changed files into your branch directory (overwrite read-only files)
  • Close visual studio
  • Rename your local source directory back to its original name (get rid of the one VS recreated)
  • Reopen your branch project
  • Two options now: you can go offline then back online again to let VS figure out what changed, or just check out your whole folder and then check in again. Just make sure you don't have anything else checked out before you do it!

It's a shame that this hasn't been put into VS as a native feature yet, but when you consider the complexity of un-shelving into a code merge, and preserving history, etc, the task becomes complex. Good luck!

1
votes

Multimerge extension (MultiMerge.2017, MultiMerge.2019) worked like a charm for me. (Or rather to the extent that TFVC tools as such cannot merge by reapplying a patch.)

No tfpt for VS 2017 and VS 2019. The unshelve /migrate command has not been incorporated into tf neither. So nothing that works out of the box as yet. (Last checked on v16.7.5)

0
votes

Until now (Feb 2020) TSPT is not available in Visual Studio.

The workaround i found is to create a new Branch and use a tool like WinMerge (http://winmerge.org) to compare and merge changes from Main to the new Branch then when it's all right undo the changes on the main branch.

0
votes

Chiming in late on this one, but I got around it by getting the changeset I needed in branch A. Renamed folder to branch B. Now my new branch has the changeset I need. Then just force Get Latest under advanced to re-get the original branch A back as it was. My Branch B was brand new, so I didn't need anything else from it, not sure if that's the same situation for you, but was a quick enough fix.