I have several checkins related to a single work item. Is there a way to get a summary of all these checkins, so I can see the difference between files before I've started working on them (like, at the moment of changeset A), and their final form (changeset B)? I would use View history and compare the folders of changeset A and changeset B, but that will give me lots of diffs that were made by other people in different files that are of no interest to me.
Edit: As suggested by Patrick-MSFT, I tried to use TFS Sidekicks, but for some reason I don't seem to get any result whatever combination of filters I use.
You can achieve this by using TFS Sidekicks. You can search for your single work item and it will give you a consolidated view.
Install sidekicks for your relevant TFS version
Open side kicks and connect it to TFS (usual tfs dialogue)
Click Tools -> Code Review Sidekick
Click by Work Items and select the appropriate Project and Query (TFS explorer workitem query). Alternatively, you can search by
changesets
Select the appropriate work item.
This will show all the changes for that work item
In your case , you want to compare all of the changes to a file,
from its state before the first checkin of this workitem and the
last checkin of the workitem (collapse all of the changes)
enter code here
Right click the file you are reviewing, the one associates with the
highest changeset number, and select 'compare with previous (not in
view)' This will show you the complete difference in your VS configured
diff tool.
Note: If the file is new and has multiple checkins, select the
one with the maximum changeset it, and select 'compare with oldest
in the view'
You can use tf difference command to compare the changes between two changesets for a specified file.
tf difference /version:669~672 program.cs /format:Context
Related
Is it possible for the branching diagrams to be automatically generated by Visual studio (using info from TFS)? I know there are simple tools like this, but they have no dates! and they don't show when it was merged back into the trunk branch.
I'd love for it to generate a diagram like this:
http://i.imgur.com/Qp2XTc6.png
It needs to have dates of when the original branch was made (from trunk)... and when it was merged back into trunk.
Thanks!
If you right click on a changeset and select "track changeset" you get a view of where the changeset is and where it has been merged. You can then switch to Timeline View and see this overlayed on a timeline with dates.
http://msdn.microsoft.com/en-us/library/dd405662.aspx
There is a command line tool for TFS that at the very least can show you all of the branches that came off of trunk (and their children). It is:
tf branches <YourTrunkBranchPathHere>
I am doing a merge between two branches and TFS/Visual Studio 2013 is identifying 1800 files required to be merged. However, doing a diff between the two branches shows that there are only ~100 that are actually different.
The pending changes window mostly corroborates this, as all files are listed with a [merge] status except those which have actually changed; those have a [merge, edit] status.
Is there a way to filter the pending changes list to only show files which are really changed so I can do inspect the differences visually? It is very error prone to have to scroll through and manually do this, skipping items that show only [merge].
My current alternative would be to do a diff on the branches, and specifically look in the pending changes window at files which are identified as different, but that is rather cumbersome for something that should be simple.
Edit: Here is a screenshot of the pending changes window. I only care about the items which are [merge,edit] as it means there is a change and I want to see the diff. Conflicts will be shown in the Resolve Conflicts window. I don't care about [merge] items, as they are identical. There are 1000s of files with no changes, but I want to single out the ones that have changed and inspect the diff.
Try the following trick:
In Team Explorer, Ctrl+A all the included changes, right click and select Undo...
You'll get the Undo Pending Changes dialog with all the items selected. First of all, uncheck everything. Then observe that you have a column named Change and you can sort by it to have all the [Merge] changes stacked together, and you can check them all together and undo only them with a single click.
There is a tool which achieves that, "qbus vMerge" - which is a Visual Studio 2012/2013 plugin available in the Visual Studio Gallery. But it's only free for team projects with up to 5 registered users. In the pre-check-in dialog, you can filter the changes by Edits, Deletes and Adds.
Link:
http://visualstudiogallery.msdn.microsoft.com/cb2f3f5b-7cea-4f2b-9d47-0e51b2619bd0
Confession: i am one of the contributors.
You can do the merge and before checking in the files, just compare your branch folder with the latest version. So if you are merging from anywhere into branch-Servicing for example, Compare $/branch-Servicing with your local workspace for that branch:
You will get a list of all files that are binary different. With a simple double click, you can view the diff.
If you want to view all changes in a merge, excluding merge-only with no changes, the easiest way is to run tf diff from the VS command line. This will use the diff tool on all changed files. I believe this shows adds as well as edits. I do wish you could sort the pending changes window by type of change action like in previous versions.
I have been struggling with the same issue. ChangeType used to be a column that was available in the list view of vs 2012 pending changes. I was hoping it would be added to 2015, but no such luck.
Here is a command-line way of doing this against the pending changes:
tf status {pathToWorkspace} /format:brief /recursive | find ", " > c:\merge.txt
ex:
tf status c:\tfs\main /format:brief /recursive | find ", " > c:\merge.txt
It's not pretty, but at least it gets the filtered list easily.
Summary of: http://thesoftwarecondition.com/blog/2011/05/01/tfs-pending-changes-ignoring-files-which-are-identical-to-the-originals/
Method 1: TFS Power Tools
Install TFS Power Tools and execute tfpt uu /noget /r * in the root of the branch. As a result, TFS will go through and undo checkouts for any unchanged files whilst leaving your modified files untouched.
Method 2: Undo Checkout
Another option is to "Undo Checkout" all the changes, and clicking "No to All" when asked to confirm for undo checkout. This way Visual Studio will "undo checkout" all the files that are not changed, and all the changed files will remain checked out.
Drawback: this method undoes renames.
My question would be why do you care?
If you do the merge TFS will figure out at run time that the files do not need modification and you will not see them as changed in the annotate tool. However if you pick-and-choose the files to merge you will leave a bunch of "pending merges" hanging around that you will have to deal with later anyway...
If there are conflicts TFS will highlight them to you for dealing with.
If you do need to compare before you merge you can use the built in diff tool in Visual Studio that will let you diff a branch (or just folders) local->local, local->Server or Server->server.
With Visual Studio and TFS, is there a way to have a diff showing in a single page changes for each file before doing a checkin ? Instead of having to do diff of each file one after the other.
Similar to the UI of GitHub for Windows when doing a commit:
file1
diff
file2
diff
...
Thanks,
Edit: as mentioned by Jehan33 the view I'm looking for looks like this (it's available on the web portal AFTER a commit):
This view is available after the check-in for the change sets where it will display all the file differences for a changeset in single page in web portal. Its not possible to do the same before the check-in.
Assuming your are using Team Foundation Version Control. If you right click on the folder where you have pending changes and click Compare. Select the options
"Show Items that exists only in source path", "Show Items that exists only in target path" and "Show items that are different", you will get the desired view.
The closest thing I've found was Diff All Files.
You can choose to combine all changed files into one and compare. Sadly there is no 'lines of context', however the code is open source and you can choose an external diff tool which may achieve this.
I'm interested in seeing the latest changes that landed to a solution with TFS (I'm using Visual Studio). However, I can't seem to find the option: using View History on a solution or project brings up the history of the file itself. Am I missing something?
If you right click on folder the containing a solution in the Source Control Explorer window you'll see all changesets. It's obvious but I had to ask for it too. I am using TFS2010/VS2010.
Edit
Here are the steps:
Team/Connect to Team Foundation Server / select Team Project/ in Team Explorer dblclick on Source Control and in Source Control Explore right click folder containing your solution select View History and here you are.
The View History command will list you all the changesets where the file/directory was changed (add/move/content changed, deleted, etc.).
So if you do a View History on a .sln or .csproj file you'll see only the changes that were made inside the file's content, not on the "Visual Studio Item" and its related item.
To sum up, the View History command is only a File System history, there's not a smarter logic out there.
EDIT
The only way to know what changed inside a solution or project is to do a View History on the common denominator (i.e. the directory that contains everything you want to view history). But it'll still be a File System kind of History.
There's not Logical History for Solution and Projects in Visual Studio. For instance you can't know what files where added to a given project your viewing the history from two given versions. Or what projects were added/removed in the solution.
All the pieces are there (because all the changes are stored in the .csproj or .sln), but the feature itself that parses the content and retrieve the logic you want to see doesn't exist. (by the way, it's a great feature and I agree it should be there).
Bottom line: TFS/Visual Studio gives you two history system:
Based on the source control/file system, by displaying changesets.
Based on the source control/file system, by displaying labels.
That's all...
Right click on folder in solution explorer, and choose View History. Then you can see all the Changesets listed that apply to that directory. Then right click a particular changeset and choose Changeset details... to see what changes occurred in that changeset.
Is it possible to check-in only files that contain modification with Team Foundation Server? I mean is there an option to activate this somewhere?
I need it when an outsourcing company send us almost an hundred source code files and I want to check in only the modified ones.
When you perform a check in, Team Foundation Server will not accept items in your changeset that are unmodified, however the rest of the changeset will succeed. If all files are unmodified, you'll get an error and your changeset will not be committed. So if you're just worried about cluttering your history with changes that didn't actually change the content, then TFS will take care of this for you.
However, it can be obnoxious to have a lot of pending changes that don't actually have edits. If what you want to do is only see what's actually modified for code review or just general sanity purposes, the TFS Power Tools contain the tfpt command, which has an "Undo Unchanged" feature that will undo the check outs on unmodified files.
The undo unchanged command has the following usage:
tfpt uu - Undo unchanged
Undoes redundant pending changes. If the state of an item with a pending
change is the same as on the server, then the change is undone.
Usage: tfpt uu [/changeset:changesetnum] [/recursive] [/noget] [filespec...]
/changeset Compare the workspace to item states at the changeset
version specified instead of the latest version
filespec... Only check the listed filespecs for redundant changes
/recursive Check the specified filespecs with full recursion
/noget Do not run get before checking
The /changeset option may not be used with filespecs or /recursive.
For example, the following command will do a recursive get on TeamProject, provide a list of files with redundant changes and then prompt the user if they want to undo them:
tfpt uu C:\TFS\TeamProject /recursive
TFS ignores unmodified files during the checkin.
However, if you want to see what files are unmodifed before you check in, you can do this (carefully):
Select all files in the Pending Changes window
Right click and Undo Pending Changes
If any files have been modified, TFS will ask if you wish to discard your changes. Click No All.
Locks on all unchanged files will be released, leaving only the changed files in your pending checkin list.
But be very very careful which button you press!
By default TFS will only check in files that are modified, in fact I don't think it is possible to check in *un*modified files. If you use the command line unmodified and not checked in files will be recorded.
By default checksums are compared to avoid uploading files.
I'm not sure that there's a way to do this within Visual Studio. You might want to try a tool like Beyond Compare to compare the folders to find out which files have changed, then just check out those files. Beyond Compare also has excellent integration with Visual Studio.
Beyond Compare
In Solution Explorer, you need to right click on "file" or "folder", and then click "Add files to source control". This is using VS 2015.