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

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

Related

TFS 2013 - Merging Word Documents

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.

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.

Remove unchanged (content same) from pending files list in Visual Studio?

This is not a duplicate of an existing and answered question, like this one.
It is well known that VS pending files list shows all checked-out files, some of them might have no edits at all. And the recommended solution to remove those files without an edit is to run a TFS Power Tools command, as answered here.
However, this doesn't apply to the files that were changed (by a mistake, or on a purpose), but the change was manually reverted. In other words, if the content of two files is binary (or literally) the same, the "Undo Unchanged" command might still think the file has changed and does not remove it from the list.
Is there any way to force TFS PT to perform content-based comparison for pending files vs. latest server version?
Use local workspaces instead of server workspaces (on VS/TFS 2012 or later). With local workspaces, the only things that show up in the "Pending Changes" window are actual modified files.

Renaming files: Visual Studio vs Version control

The problem with renaming files is that if you want to take advantage of Visual Studio refactoring, you really need to do it from inside Visual Studio.
But most (not all*) version control system also want to be the ones doing the renaming.
One solution is to use integrated source control, but this is not always available, and in some cases is pretty clunky.
I'd personally be more comfortable using source control separately, outside of Visual Studio, but I'm not sure how to manage this question of file renames.
So, for those of you that use Visual Studio, which source control do you use? Do you use a VS integration (which one?) and otherwise, how do you resolve this renaming problem?
(* git is smart enough to work it out for itself)
I use SVN (TortiseSVN as the client) and use the Repair Move command from the commit dialog heavily. This allows me to rename the files within VS and resolve the rename when I'm ready to commit to keep version history.
As far as using the VS integration, like you, I find all VS integration clunky and do not use it.
mercurial usually prefers to do the renaming via hg rename however it can also detect renames from an outside source by using hg addremove -s 100 (or less than 100 if you want to match a rename with alterations) so clearly you can let VS do the rename and get mercurial to catchup with addremove.
We use SVN (TortoiseSVN to be exact), and i am always bothered with the renaming problem. The simplest solution i've found is to remove the files from the project, rename them via TSVN and add them back to the project. You have to manually update includes for renamed header files, but this is relatively easy using find&replace.
We use Team Foundation Server, and it works with no problems. I've also found that moving to using a fully integrated client has improved my workflow, as I don't need to flip between applications just to do trivial tasks.
We develop "Plastic SCM" and the Visual Studio Package supports move operations. But I see your point, I'm getting more and more comfortable with the idea of not having plugins/packages and then have the version control working behind the scenes and simply detecting what happened without having to be "plugged in" into the IDE. In fact we're working on it for next release...
Besides the above advice, for Visual Studio 2008 I found that after making all global changes to any file being renamed from within VS, including right clicking the file and renaming it, as well as a global search and replace for all strings, replacing the old file name with the new file name, you must, if the file is the initial startup file, right click and select it as "set as default page". Otherwise you'll may well get the "The resource cannot be found." error on runtime.

Perforce integration with visual studio without project files being checked in to perforce

I am working on a large source base (approx 15K files) decomposed into about 25 projects. I want to keep the source in perforce (and am evaluating perforce to that end) but due to complications in the setup it isn't possible for me to keep the visual studio projects in source control, I know in theory the answer to this is to check the projects in, but that isn't feasible (we would end up with projects for several versions of VS checked in, and additionally several variants of each of these, instead they are generated automatically and this setup works very well).
Is there a way to get VS to checkout files for editing as it goes without adding the project to perforce, to avoid the user having to go to the perforce client and manually check out each file for editing as they go? Alternatively (and even better) is there a way to get VS to recognise that the files in a project are under source control, without having to add the project to source control also?
I know we could also take the tack of having every user check out for editing all files they might potentially want to edit ahead of time, then revert unmodified files before submitting their changes, is there a performance penalty in perforce in taking this approach?
In your case, I'd suggest not using the visual studio integration for Perforce.
You can either add Perforce commands to the Tools Menu, or try Nifty Perforce from Google:
http://code.google.com/p/niftyplugins/
One option is to use Perforce as if you were disconnected from the server and reconcile your changes later, rather than telling Perforce everything you do before you do it. (This is roughly equivalent to the workflow in CVS or Subversion.) You would synchronize your working copy, go off and develop, and then ask Perforce to figure out what you did while it wasn't watching.
Perforce has a nice document describing the process: Working Disconnected From The Perforce Server
One thing the document doesn't mention is the allwrite clientspec attribute, which marks all files in your working directory as writable instead of only the files you have checked out.
For the sake of completeness: There is a new tool for your wish called P4VS. I like it better that P4SCC which never worked for me as I wanted.

Resources