I have a file which has been modified several times in different versions of the product. I would like to search all the changesets in the history of the file and see if a particular string "CK_CLIENT_TIMEZONE" has been part of the changes in any changeset.
Currently I am doing this by viewing the history of the file and comparing two adjacent changesets manually. It will be excellent if there was a way to search only the changes in history and see which changeset had the change I'm interested in.
Related
Why does TFS only merge files and Comments when there can be an arbitrary number of additional fields? Can this behavior be changed?
Our check-in policy requires these other fields to be set, but having to manually copy them over defeats the purpose of using automation (the merge tool).
Also, if I preemptively have any of these fields manually copied over, those are then deleted (even when identical)... So because I tried to manually associate the work items I knew it wouldn't for me, it unset them, so I have to do it yet again.
This applies to both VS 2015 and 2017, on TFS 2015
It is what it is. The behavior you want is not how it was implemented.
There are a couple of extensions on the marketplace that add some of what you want:
https://marketplace.visualstudio.com/items?itemName=AdamLove.MergeChangeset2019
https://marketplace.visualstudio.com/items?itemName=KulikovDenis.AutoMergeforVisualStudio2017
https://marketplace.visualstudio.com/items?itemName=DieterVantilt.teammerge
The idea is that by following the merge tree you can derive the information. Why would you duplicate the content from one commit to another?
As you can see Team Explorer is extensible, creating or extending one of these existing extensions to match your process is entirely possible.
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.
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.
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.
I'm issuing the following command to TFS:
>tf merge /baseless c:\ws\source c:\ws\target /recursive /version:C100~C100
But I have a large list of changesets that need to be merged. Is there a shortcut for this, or some way to specify a list, for example:
>tf merge /baseless c:\ws\source c:\ws\target /recursive /version:C100,C108,C110,C800,C1001,etc...
If powershell is an option, below script should help (not tested!):
$cslist = 1,23,45,456,568 #list of all changesets
foreach ($cs in $cslist) { & 'C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe' merge /baseless c:\ws\source c:\ws\target /recursive /version:C$cs }
Grabbed this from another post, you may have seen it but as I haven't ran into this I'm just trying to lend a hand.
You have a couple options:
If you know the changesets you want to merge (or the changesets you want to avoid merging) you can choose a folder up the structure from the files you want to merge then do the merge by selecting the specific changesets you want. This is a little complicated if you have changesets 2000,2001,2004, 2010 and you want 2001 and 2010. You can only merge consecutive changesets in the list per merge so you would have to merge 2001 then 2010. This is still better than merging many files if you have more files then changeset groups.
If you want to merge everything under that folder up to a specific changeset or most recent changeset you can do that in one bulk merge.
In both of these you will still have to resolve issues where a different change was made to the same line in the same file in the source and target branches.
OP: Merge multiple files in TFS
The following extension claims to do this:
TFS Productivity Tools - Extended Merge 2012
ExtendedMerge extension provides workaround for several merge features
not implemented by TFS:
TFS merge leads to bulk check-in operation that puts files from all
previous changesets into one big merge changeset.
TFS allows only for
consecutive changesets being cherry-peeked by merge operation.
TFS
doesn’t allow choosing changesets for cherry-peek merge by selecting
work items.
TFS merge dialog doesn’t have “force” and “baseless”
options.
You'd might also want to upvote this feature in the Visual Studio User Voice.