I want to associate a changeset with a workitem as default to associating it in TFS 2012.
Trying HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\**11.0**\TeamFoundation\SourceControl\Behavior #ResolveAsDefaultCheckinAction = "False" is not useful for tasks which "State" is "Active". It is ok when the state is "New", "Proposed" etc...
Do you have any idea to do this for all states?
It's a long story, The workaround that will work will be as the following:
Checkout this link here
http://msdn.microsoft.com/en-us/library/ms194965(v=vs.110).aspx
Basically whats it is saying on a given work item type there is an
action on work item transitions called
"Microsoft.VSTS.Actions.Checkin". When you checkin code the source
control system looks at the current state of the workitem your
associating with the checkin. If any tranition from this state has a
checkin action associated then it will move to that given state as the
default action.
The solution is to remove this action - this is then for all users of
TFS
Copied (Gary Howlett), for the full thread click on the following link:
http://msdn.microsoft.com/en-us/library/ms194965(v=vs.110).aspx
My answer is not the answer you want but it is the ONLY answer to this question. The link I am providing gives you the two options (including the answer given by M.Radwan -MVP) that are available to you: Changing the Default CheckIn Option to Associate in TFS 2012
** ONLY AVAILABLE IN VS 2012 ULTIMATE **
Updating Visual Studio clients to change the default option to Associate
This option sounds good. Unfortunately it only works under one scenario. With the Team Explorer 2012, there are two primary ways to initiate a check in. You can initiate the check in from the Pending Changes Pane and from My Work Pane. By default if you initiate the check-in from either location, the default option will be Resolve. Once this fix has been applied, it will update the default option when initiating the action from the My Work pane but not the Pending Changes Pane.
From my experience, most check-ins are initiated from the Pending Changes pane or by right clicking on a location in Solution explorer. Either way you will end up on the Pending Changes pane, where you can associate a work item by query or by ID. Unfortunately the change has no effect on this and will continue to default to the Resolve option as shown below.
In Team Explorer 2012, there is a new Pane called My Work. This Pane is designed to group and manage all of your current work including code, break points, and associated work items. This provides the ability to suspend/resume your current work so you can switch to work on something else and then come back to it later with everything the way you left it. After applying the update, initiating the check-in from here will change the default option to Associate.
Regedit; set: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\TeamFoundation\SourceControl\Behavior\ResolveAsDefaultCheckinAction = False
Exit all instances of Visual Studio 2012.
Open the Developer Command Prompt for VS 2012 with administrator privileges. Run devenv /setup to ensure that the registry is picked up by Visual Studio.
Related
Does a feature like "TFS auto-checkout before checkin" exist, so that I don't checkout any file until the moment I say "checkin", e.g. in case I only change files temporarily - which happens all the time.
In other words, client-side I want to work as if using subversion, regardless of what the TFS server might think. This must be possible, I just wonder if it is easy to setup.
In yet other words, until and unless I say 'checkin', other users shouldn't (be able to) bother what files I'm editing.
These answers are fine assuming you always work in Visual Studio. But imagine the scenario of editing a bunch of files outside of Visual Studio and you want to use Windows Explorer TFS powertools to automatically checkout files which were just modified. Well, there is no automatic checkout. What I ended up doing was to sort the files by the "Date Modified" column and then individual selecting the modified files only. You can't select any files which might be added, as the TFS power tool Windows extension will grey out the "Check Out for Edit.." The other frustration is that TFS power tools doesn't have a file icon to differentiate if a file is currently checkout or simply not yet added to TFS. Basically, TFS is terrible working with more than file at a time unless you are exclusively working within VS, but who does that.
SVN kicks TFS when it comes to this type of scenario.
You can tell Visual studio not to check out on edit, go to tools, options, source control, environment. Then select the behaviour you want. If you choose editing to "do nothing" and saving to "prompt for checkout" it should be pretty close to what you want.
You could also look at svnBridge which allows you to use TortoiseSVN with TFS. I assume that the point of svnBridge is to allow developers used to SVN to use TFS without having to change the way they work, so it should meet your needs.
A combination of both of these should get you close.
From time to time I hear from people who dislike the automatic check out behaviour common with TFS. One of the great things about TFS is the the pending changes list that shows you the files you have currently checked out and allows you to easily undo any un-intentional check outs. While I personally find the auto-checkout features a productivity boon - like most things there is a preference that you can use to adjust the default behaviour if you find it causes problems with the way you like to work.
In Visual Studio 2008 (with the Team Explorer 2008 installed), go to Tools, Options, Source Control, Environment and change the Checked-in items for Saving and Editing to "Prompt for check out" rather than the default which is "Check out automatically".
No. When you check in TFS will checkin those files, you have to just undo those files.
However checking out a file doesn't stop others from checking them out, unless you've locked them. This non exclusive locking is the default behaviour.
No. But you can do one thing - Open solution in 2 Visual Studio, One in which solution is Online and another in which solution is offline. Do all your changes/work on Offline solution. After completing your task.
Go to first VS (Online) and checkout the files containing your changes.
Go to Second VS (Offline, containing your changes) - It will prompt for file changes and click "No to All" so that all your changes persist.
Press Save All.
First Solution (Online) will prompt for new changes and click "Yes To All" so that all your changes done in offline mode will get in new files.
Get Latest. - Any conflicting changes will be reflected (Try automerge - if you're lucky will work perfectly)
CHECK-IN
Though a tedious task but a workout for your question.
We have a few developers who don't work here anymore, but didn't check all theirs changes into Team Server before they left.
Now their usernames don't exists anymore, and I can't access their pending changes to undo them....
I found a way, not needing command line.
With Power Tools installed (both in 2008 and in 2010 version), Visual Studio shows a node for Team Members in each project. If you right-click on one of the members, you can choose to view all their pending changes. Till now nothing new. BUT, I suddenly saw, in the right hand upper corner of the pending change list, a link that says "Modify Query".
I opened the window, and in it was an input field that let me change the username. I changed it to the username I wanted, and I got his list of pending changes!
Here's a link to the TFS 2008 Power Tools:
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=FBD14EEA-781F-45A1-8C46-9F6BA2F68BF0
and the TFS 2010 Power Tools:
http://visualstudiogallery.msdn.microsoft.com/en-us/c255a1e4-04ba-4f68-8f4e-cd473d6b971f
Edit by woppers:
I don't have enough Rep to comment so I have to make an edit. I had the same issue as the OP but I am working in TFS 2013 so the procedure is slightly different. Here's what I did.
Go to:
Source Control Explorer
right click on the collection you are working in
Find
Find Changesets...
Enter your LanID in the “By user:” field
Click search
Click find
That will show you all of your pending changes.
Highlight one of them and click “Details...” to view the info in them.
As an administrator of TFS you should have some option of global check in.
something like that in the command line: tf lock /lock:none /workspace:workspace;username $/code/foo.cs /s:http://server:8080
or better yet:
tf undo /workspace:workspace;username $/code/foo.cs /s:http://server:8080
To expand a bit on the awesome answer provided by xr280xr... I needed to undo pending changes of a former employee, and this worked for me on a TFS 2013 server, using VS2015 on my own desktop:
Right click the folder in Source Control Explorer > Find > Find
by Status and enter * as a wild card. You can reduce the results to
a specific user if you know the user name.
When the results appear, you can right-click and select Undo. The
Output window should confirm success.
Note that if the former employees' workspace is on another PC, you'll continue to see the pending changes they have, but they will no longer prevent checkout, build, etc.
I'm guessing that deleting the former employees workspace will get rid of the pending (now-undone) changes, but I haven't tried it yet.
I am using a custom workflow for tasks in TFS 2010. However, when I check in code using the Pending Changes window and "Resolve" a task it is automatically put into a state of Closed with a reason of Cut.
Is there any way to modify this behavior?
The action that is defaulted to in Visual Studio when you associate a check-in to a work item is controlled by the Microsoft.VSTS.Actions.Checkin action in your process template. See http://www.woodwardweb.com/vsts/000230.html
In the visual studio Source Control Explorer window, I can see my own "add" operations, but do not see the "add" operations for other users. I can see all other operations (rename, edit, etc), but cannot see any add's.
Anyone know how to turn this on, or how to view add's otherwise?
I don't think there's a way to view other people's pending adds. The items shown in SCE represent the latest state on the server, modulo any changes that are pending in the currently selected workspace. In other words, if you switch to another workspace in the dropdown at the top, you won't even see your own pending adds.
Closest substitute I can think of is the "Team Members" feature introduced in the Fall '08 power tools. In short, you can quickly view anyone's pending changes (along with shelvesets & checkin history) by right clicking on their name in Team Explorer.
In TFS Source Control Explorer it shows pending changes (edit,[more]) with my name, but the Pending Changes window does not show any pending changes.
What I thought is, months ago my Visual Studio crashed, and at that time some files were checked out (which I was not aware of, due to the automatic checkout nature of TFS). Due to that, I copied a new VMImage, without undoing the pending changes (which are currently showing in Source Control Explorer).
One of my team members wants to checkin a new version of that particular file. Now, I need to undo my pending changes.
It sounds like you have them checked out under a different workspace. Try going to View->Other Windows->Source Control Explorer, then open the Workspace dropdown near the top of the screen, and select "Workspaces..."
I would suggest simply deleting any extra workspaces shown.
Steps to reproduce:
Make non-conflicting edits to files in TFS.
Get the latest version of the project from source control.
Sometimes, pending changes will be marked as non-pending and all project files are saved, resulting in no pending changes in the Team Explorer.
Workaround:
Right-click on the solution folder in source code explorer
Select "Compare"
In the search results, manually open files which have been edited/added and save them. This will register them as a "Pending Change" in team explorer.
This is because TFS apparently uses file properties rather than actual text comparisons to register pending changes in Visual Studio.
Tested on: Windows 7, Visual Studio Ultimate 2012.
Additional feedback from my supervisor: "Not sure if it was the issue this time, but that can happen when you disconnect from the TFS server (which sometimes happens without it being obvious). File | Source Control | Go Online usually fixes it (and the option isn’t available if you are online)."
TFS is buggy everywhere. i think you need to check out the parent folder and use TFS power toys to undo all the rubbish unchanged item.
TFS use file property to indicate whether or not a file has change, which sucks the most, and produce tons of usability problem.
If the file that you checked out is not part of the current solution, it might be hidden by the "Filter by solution" toolbar button on the Pending Changes window.
Get your changed files check out for edit
I had the same problem, I re-started VS, opened the solution and all the changes are now being displayed in the pending changes window.
Did you try to checkout the file from the Source Control Explorer view ?
For me, it worked.
I have just had a similar issue in VS2012.
To resolve the issue, I toggled the "Show xxx" dropdown to "Show Solution Changes" and then back to "Show All". The files that were missing from the list then re-appeared.
I was having a similar problem and it was due to the fact that my local version was a "non-version control solution" for some reason! meaning that my local was not really connected to the actual source code on tfs.
fix: Got the latest with override option checked. I know this could be painful if you had a lot of changes made to your local.
I was facing same issue the first answer was really helpfull. But make sure to check "Show Remote Workspaces" if you are working from different computer. In my cases the files where checked in and edited from home computer and it was showing pending changes. Deleting unwanted workspaces helps to solve this problem.
a different workspace on the same machine
a different workspace on another machine
TeamExplorer -> PendingChanges -> Excluded Changes ( I included this only because you didn't specifically mention they weren't there)
especially if you right clicked a node in solution explorer and chose check-in
Filtered based on TeamExplorer Settings #Oliver
Use a Tfs Query to find the pending changes and what workspace they are pending from.
Another option is to permanently or temporarily give them permissions to overwrite your lock. Then he can check-in anyhow.
I've seen this problem. Sometimes when I have the pending changes window in 'flat display mode', it doesn't display my changes. I find if I click the toolbar icon at the top of the pending changes window with tooltip 'Change to folder view', then they display. I think this is a bug in the Team Explorer Client.
sometimes I can not lock a branch because users have things checked out, but when I ask them about it, the pending merges/changes, only folders come up with no objects to change. What's with that?