TFS: comparing shelveset files with local version

北城余情 提交于 2019-12-03 00:57:03

Export Shelveset to a local folder using Team Foundation Sidekicks and use file comparison tool to compare with local version.

ChrisTorng

Up to How can I easily diff/compare 2 shelvesets in TFS?

Use VS2013 ShelvesetComparer or VS2012 ShelvesetComparer, shelve local version into another shelveset, then compare between two shelvesets...

Though this will make another unneeded shelveset, and you can't edit local in file compare editor.

In VS2015 Update 3:

  1. Go to Pending Changes > Actions > Find Shelvesets
  2. Select the Shelveset you want to compare to, right click and choose View Shelveset Details
  3. Right Click on the file, choose Open
  4. Right Click on the tab, choose Copy Full Path
  5. In Solution Explorer, right click file, choose Compare...
  6. Paste the full path into Source Path and click OK

I don't think that it is possible to compare a shelved version with a local version in Visual Studio, however I'll be very happily corrected on the matter.

Although this isn't the ideal way to do it, depending on your comparison tool you may be able to tell it to compare the shelved version to a local version (workspace). I use Beyond Compare, and this allows you to open a file to compare to. So from the shelveset I do a compare to Latest, and then replace the 'latest' with my local workspace version.

Unfortunately I've just checked the built in comparison tool and it doesn't provide this option.

Here's a simple hack that works:

  1. Click on 'Unshelve'
  2. Select proper shelveset
  3. Click on the 'Details' button
  4. Right click on the file you wish to compare
  5. Click on 'View'
  6. This opens up in your text editor, save it to your desktop or wherever you like.
  7. Open your file diff program and compare the saved version to your local version.

In a nutshell, save a copy of the shelved version you retrieve from the server and just do a manual compare using your diff tool.

I have been looking for a way to do this for quite some time. I wonder how hard it would be to create a vs.net plugin to do this for you.

This is a little laborious but it does the job:

  1. Right click any file in Solution Explorer and select 'Unshelve Pending Changes...' from the context menu.

  2. Double click the relevant shelveset in the Unshelve dialog.

  3. Double click the file that you want to compare. This will open the sheleveset version of the file in notepad.

  4. Save the file somewhere on your local machine.

  5. Close all the dialogs.

  6. Right click the local workspace version of your file in Solution Explorer and select 'Compare' from the context menu.

  7. Change the target path to that of the file that you saved earlier and click OK.

In TFS, create a new (temporary) workspace, and map it onto a new local folder. get latest version into the new workspace, then unshleve the sheleveset into the new workspace. This gives you a temporary local copy of the source with the sheleveset applied. Then change back to the orignal workspace, click on file => source control => compare. Then enter the local folder paths of the original workspace and the new temprary workspace, to compare your original local version with the lcoal shelevest version.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!