TFS 2013 - Merging Word Documents - visual-studio-2013

I have word documents (.docx) checked into TFS and would like to be able to merge them. This worked great in SVN so I'm perplexed why this won't work in TFS.
In Visual Studio, I have setup the diff and compare tools for word documents to the TortoiseSVN scripts diff-doc.js and merge-doc.js respectively. The setup looks like the following:
Diff:
Command: C:\Windows\System32\wscript.exe
Arguments: "C:\path-to-scripts\diff-doc.js" %1 %2 //E:javascript
Merge:
Command: C:\Windows\System32\wscript.exe
Arguments: "C:\path-to-scripts\diff-doc.js" %4 %1 %2 %3 //E:javascript
In the TFS team collection, I configured the file type *.docx to be mergeable.
However, when it comes time to merge a word document, I only get the options Take Server Version and Keep Local Version. The option Merge Changes in Merge Tool is missing.
Do I need to setup something else to make this possible? Or is it just not possible with TFS?

The reason for why the option Merge Changes in Merge Tool is missing. This Merge Tool is based on the diff window. Since word file type(.docx) is not supported by this diff window. You can easiy test it. Just compare two word files, will get below error: One or both of these files are not text files and cannot be opened in the comparison window. So this file tpye also not supported in the default merge Tool.
If you want to compare or merge this type file, you need to configue comparisonand merge tools per file type (extension) via Tools -> Options -> Source Control -> Visual Studio Team Foundation Server -> Configure User Tools" button. More details you can refer this question MS Office file diff under TFS
Update
This option 'Merge Changes in Merge Tool' not support when you are using configure tool. It can also be explained since this tool based on the diff window. Unfortunately, you can only use Take Server Version and Keep Local Version or Keep Source Version ,Keep Target version.

Related

What does /recursive actually do in Team Foundation Server Power Tools?

I regularly use Team Foundation Server Power Tools to run a scorch, treeclean, uu, etc.. Most of these tools have an option for /recursive that is described as
/recursive Switch from one level of recursion to full recursion
I've scoured the internet and am still unsure what /recursive actually does. An example question that I've been unable to tell the difference between running "tfpt scorch" vs "tfpt scorch /recursive".
It seems like something that probably increases the time the tool takes to run while making it (somehow) better?
The /recursive switch is typically available on commands which affect version control folders or files. It is used to indicate that you want to perform the task on a specified folder and all of it's sub folders.
i.e. If you have a version control folder structure similar to $/MyTeamProject/MyBranch/MyFolder/SomeSubFolders and you have checked out all of the files. You know that you haven't changed all of the files so you could run tfpt uu $/MyTeamProject/MyBranch/MyFolder. This will undo the pending changes on the files that haven't changed but only for MyFolder, if you add /recursive it will undo changes in MyFolder and all of the targets sub folders as well

TFS View All Changed Folders/Files With Filter Options

We are using Visual Studio 2013 with Team Foundation Server 2012. We are using local workspaces. We are just moving from another source control program (StarTeam) to TFS.
One of the big things we are missing from StarTeam is the ability to customize our view, and specifically a view of all the local non-current files. Our projects are enormous with multiple directories and sub-directories. If one or more files within a directory is out of date the primary folder in TFS still shows Yes under Latest. This makes some of our users think they are up-to-date when they are not. In StarTeam we could show all descendants and filter to our hearts' content - based on status, size, location, locked or not, who last changed it, who created it, the check-in comments, dates, times, etc., etc.
The closest thing we've found in TFS is to right-click on the main branch and select Compare. This almost does what we want, but it has very limited ability to filter and it takes forever.
I tried the Diff All Files extension but that brings up a separate compare window for each different file with the actual differences highlighted.
I have Beyond Compare set up as the compare/merge tool in Visual Studio but that works only for files, not folders/branches.
Is there any native functionality that can do this? Or an extension? Or a way to set the external compare tool to compare folders as well as files? Or a way to get the primary folder to show No under Latest if any files in that folder have changed? We have a lot of frustrated users and for some reason they're all coming to me.
Thanks in advance.
I can suggest you an external tool:
Diff All Files for VS2013
"Quickly compare changes to all files in a TFS shelveset, changeset, or with pending changes."
Seems what you need.

TFS Specific Changeset files to be merged with latest version

I am in the following situation:
A Team Member worked on a task which was partially done in few changesets, few months back. These changesets were reverted and many more changes are done on same files in subsequent changesets.
I want to get the latest version of code (which I have taken) and have some option to get the older changesets (even I can merge changesets one by one) and merge it.
Though I find option to changeset GetThisVersion which gives me whole old codebase. I don't find relevant option in Visual Studio 2010. It would be great to have GUI option and not command line one.
Please help. Thanks in advance.
You can get specific version of a file from file history (view or get specific version) or with command line Need command to get a file from TFS without a workspace. But to get a folder (project, solution) state seems to be necessary to have a workspace How to get specific version of folder from tfs without creating a workspace?. I don't think that there is a possibility to merge an old and newer version. When I want to resuscitate some old code I use view in history and copy/paste.

How do I manually resolve conflicts and mark them as resolve when using TFS?

Coming from the SVN world this was dead easy:
1) do the merge and get a conflict. SVN gives you the conflicting files in the working copy.
2) resolve them any way you need to (using any external tool if required).
3) "svn resolved" to mark the conflict as resolved.
4) check in (or carry on working, etc).
Now with TFS and Visual Studio (2010), the only options we seem to have are: -
-> Merge in the TFS merge tool (text files only).
-> For non text files, take the source branch file (overwrite target branch file) or keep the target branch file (ignore the source branch file).
I need to be able to resolve conflicts for some of my file types using external tools (E.g. Erwin) and then mark the conflict as resolved.
I've tried resolving the conflict, putting the new file into the target branch filesystem workspace (i.e. the working copy) and using "tf resolve /auto:DeleteConflict". That didn't help. The local resolved/consolidated file was completely ignored when I finally checked in the merge.
Surely TFS/VS can do this!
Any help would really be appreciated!!
Thanks.
You can set up specific rules for Compare and Merge in Visual Studio. It is located under Tools->Options->Source Control->Visual Studio Team Foundation Server. Choose Configure User Tools..., and from there you can select any external tool to use for your operations. You can use file filters to define any number of rules and add here for Operation "Merge" any custom tool:
Once you have the content that you want on disk (after manually using your merge tool) instead of running "tf resolve /auto:DeleteConflict", run "tf resolve /auto:AcceptMerge". This tells TFS to accept the content that is on disk as the resolution of the merge.

Bazaar (bzr) integration with Visual Studio

What's the best way to use Bazaar (bzr) as the version control system in Visual Studio 2008?
The best I found is TortoiseBZR and the command-line - nothing integrated with VS.
I wouldn't even bother with TortoiseBZR; bzr is very easy to use from the command line.
BTW: The last time I tried it, TortoiseBZR used to lock up windows explorer while it went off to a remote repository to determine the status of files, not sure if it still does this ... ? See also this SO question.
There is no native integration to Visual Studio, but there is good GUI application, called Bazaar Explorer. It's the part of official standalone installer, and also can be installed separately as bzr plugin.
Old, I know, but since this shows up on the top for Google search, the best way to integrate is a combination of Visual Studio's External Tools, and tbzrcommand.exe and bzr.exe. You can set up things like Status to go to the output window, and things like Diff to go to the tbzrcommand GUI window.
(I'm assuming you've installed TortoiseBzr here.) Using these as examples, in VS open Tools->External Tools, then Add. For the program, browse to the Bazaar directory and select bzr.exe. Name the command Status. For arguments, type "status" (sans quotes). Select that the output should be directed to the vs output window, that the command should be terminated when complete. Open a simple file under code control and add a space somewhere and save, then under external tools, choose status to verify that it shows up as a pending commit action. (You can add these to their own menu later, once they work.)
Next, add another external command and name this Diff. For the program, browse to the Bazaar directory, and choose tbzrcommand.exe. For arguments, type "--command=diff --file=$(TargetPath)" (sans quotes). Leave the options all unchecked. Then, for the file above that you added a space, select it in the solution explorer window and choose Tools->Diff. A TortoiseBzr window should appear (along with an annoying DOS window), and show differences between the working version and the latest commit version of the file.
For something like a commit, which requires a comment, you'll have to put in arguments like "commit -m " (sans quotes) and check the box to prompt for arguments (to allow the entry of a message for the commit).
There's a project in Launchpad, but it looks like it's abandoned, and when I downloaded it, I couldn't get it to build.
This is something I'm interested in myself. Tracking adds, drops and renames automatically in an IDE is the way to go. Seeing status is nice too.
If you don't need the SCC integration, just the ability to use the tool, try the setup in this article:
http://www.codeproject.com/KB/macros/Bazaar4VS.aspx
I've ported VisualHG to work with Bazaar:
https://launchpad.net/visualbzr
It's currently an alpha version, and has only been built and tested for Visual Studio 2010, but common operations should work OK.
Edit:
This plugin hasn't moved on much, but it does now support Visual Studio 2012.
Unified SCC has support for bzr. It is commercial but claims to be free for OSS projects.
UnifiedSCC
I too was trying to use this, and found that visual studio has an option of "External Tools", which can be found under the tools tool bar. Upon trial, I found that one could create a link to the bzr.exe (or any other exe tools you may want to use). Then, it asks for arguements. It is here where you can begin to use magic.
For me, to commit changes directly, I have created an arguement of commit -m "", which commits without message to the bzr branch if one exists in the working directory (to achieve this, you also have to change the starting directory to solution directory).
I also created a push command to my launchpad using similar idealogy

Resources