vs 2008 Source Control compare options - tfs

Since I have moved to a new machine I have installed vs 2008 with team explorer again, I can't see "Compare" options which I was able to see previously.
When right clicking a source file opened, we have "Source Control", inside that I can only see the "Annotate" option but Compare option is missing. I can see the compare option when in solution explorer and right click that file, but when a file is opened and then try to compare with server version, can't see the compare option then.

Tools -> Options -> Source Control
Under "Visual Studio Team Foundation Server" select "Configure User Tools" which will allow you to configure a comparison tool.

Related

Microsoft Team Explorer & TFS: How to open ps1 with ISE?

Currently I am experimenting with Microsoft Team Explorer and TFS server. I have several PowerShell scripts checked in.
Is there a way to control which editor Visual Studio launches when double clicking on a checked out file? I would like to start ISE. Thanks in advance.
I figured it out myself, here are the steps:
Go to Tools => External Tools
Add new item pointing to C:\Windows\System32\WindowsPowerShell\v1.0\powershell_ise.exe
Ensure the arguments field contains $(ItemPath)
Go to Tools => Options => Keboard (ensure show all settings is checked)
Assign a keyboard shortcut to Tools.ExternalCommand1
Now you are able to directly open your script with ISE if its checked out and opened in Visual Studio's internal editor.

VS2012 return to a normal TFS checkin window?

VS2012 seems to remove the popup window for TFS check-ins that was in VS2010. It now seems to take over the team explorer tab in my sidebar, and buries the important things - like which files I've changed. Is there any way to return to a normal popup window for check-ins in VS2012?
For me, the best solution is based on iSid's answer: to add an external tool that pops up the old dialog.
You can do this from Visual Studio: TOOLS -> External Tools… -> Add, with the following values:
Title: Checkin (or any name that should be displayed in the menu)
Command: C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\TF.exe (this is the default VS install location on Windows x64)
Arguments: checkin
Initial directory: $(SolutionDir)
Here is a screenshot:
You can invoke from TOOLS -> Checkin (or even assign a keyboard shortcut to Tools.ExternalCommand* as described here) and enjoy the old goodies with a new style:
Note that this won't work if a solution is not opened, because of the $(SolutionDir) variable. To workaround this, you can hard-code the path to your workspace instead.
Additionally, tf.exe can be invoked with 'shelve' argument, which will show the old-style shelving dialog.
Use tf checkin command from Visual Studio command prompt and you will get the same old checkin window.
While the Pending Changes window is merged within the Team Explorer, the Solution Explorer allows filtering by what is pending to be checked in. In addition Open Files filter could also be applied. When the Pending Changes filter is applied, all or some of the files could be selected and right clicked and then there is an option to do the check in. That command takes directly to the Team Explorer in Pending Changes view. See below...
Another method is to use the Productivity Power Tools. This extension adds Windows shell integration so you can perform most of your TFS commands directly from within Windows without even having Visual Studio open. The Power Tools uses the old style windows when used from within Windows shell.
I think the easiest solution is just docking the Team Explorer tab as tabbed document (using the right-click menu). That way it will be equivalent to the popup dialog.

How can I open a single changeset in TFS from within Visual Studio

Someone emailed me a TFS changeset ID and now I am trying to open this single changeset. Is there an easy was to do this from within Visual Studio (VS 2008 if it matters)?
In Visual Studio a keyboard shortcut can be used for pulling up a specific Changeset or Work Item.
Go to Changeset
In Visual Studio open the Source Control Explorer window and while it has context press Ctrl + G. Enter the number in the Go To Changeset dialog and press OK.
I know this works in VS 2010, 2012 and 2013, but recall this working as far back as at least Visual Studio 2008.
Go to Work Item
Pressing Ctrl + G when the Team Explorer Work Items window has context brings up the Go To Work Item dialog:
In Visual Studio 2012 and 2013 the TEAM menu contains an option Go to Work Item which also brings up this dialog.
Last Word
Visual Studio is a very contextual program and what happens when a specific keyboard command is used is oftentimes influenced by what window has context. To be clear pressing Ctrl + G when an editor window is open will present the Go To Line dialog.
As with many keyboard commands in Visual Studio your mileage will vary.
In the Source Control Explorer (View -> Other Windows -> Source Control Explorer):
Right click on the folder you want to grab
Click Get Specific Version
Change the dropdown from "Latest Version" to "Changeset"
Find your changeset on via the browse (...) button.
Change to search to changeset number
Just select the result and hit ok.
Alternatively, if you want to see what changes were in that changeset...
Go to the same Source Control Explorer
Click the History button (looks like a clock)
Scroll down the changeset list that appears, double click the one you want.
This will list the files changed in that changeset as well as notes the developer put.
or, from a VS command prompt type "tf changeset 1234" (make sure that your root folder is inside of your workspace or you will have to explicitly define the team project etc.)
You don't need to remember Ctrl + G shortcut, just do as below.
Open the source Control Explorer -> Right Click -> Find in Source Control -> Changeset
Then a dialog box will appear where u can specify your changeset number hit find. And it will appear in results section at the bottom, then you could go into all its details.
In the NugGet console, you can use the TFS Powershell Snapin from the TFS PowerTools.
Add-PsSnapin Microsoft.TeamFoundation.Powershell
Get-TfsChangeset <ChangesetNumber>
Another option is to open Tools > External Tools and add a new external tool that calls TF.exe changeset and prompts for arguments where you can give the changeset number.
In VS2012 you have the option to search in changesets.
if you want to search changeset...
Go to Source Control Explorer Click the Find Changeset(looks like some papers tied together) button. it is near to history button (looks like a clock)
you can search by changes checkedin by a user,containing file,and date range
try to add as much filter as possible, otherwise it will take sometime to load.

No commands available on context menu of Source Control Explorer

I don't know what I've done, but on my TFS source control explorer I have "No commands available" on the context menu! (Panic is setting in)
From the Team Explorer I can see that am a member of Team Foundation Administrators, and I'm a member of the team project administrators as well.
What would be causing TFS to give "no commands available" on the pop-up context menu?
Additional info:
I can get to the source control explorer and with additional commands from another machine, so perhaps it's something pooched on my setup (although it was working an hour ago!)
In Visual Studio, go to Tools > Options...
Click "Source Control" in the tree
Select "Visual Studio Team Foundation Server" as the current source control plug-in.
If this option is not available, ensure that you have Team Foundation Client installed.
You need to checkout (Mapping is not enough for Moving and Renaming - for that you MUST check-out) those files/folders to your local disk, before you get the context menu on right-click that you miss.
I had same problem and from the MSDN official page I was not too much wiser :)
Anyway, I wonder what is the good reason, for which you can not move files in TFS server repository without checking-out those items to my disk. In SVN this is no problem. (And there is even no path mapping in SVN - just CheckOut :)

How to undo another user's checkout in TFS via the GUI?

As the resident TFS admin, on occasion I am asked to undo a checkout (usually a lock) that a user has on a certain file. This can be done via the command line using the TF.exe utility's Undo command (see http://msdn.microsoft.com/en-us/library/c72skhw4.aspx), but that's kind of a pain.
Is there a way to undo another user's checkout via the GUI?
Out of the box, no, but there are at least a couple of options via add-ons.
TFS Power Tools
TFS Power Tools (Visual Studio 2010)
TFS Power Tools (Visual Studio 2012)
TFS Power Tools (Visual Studio 2013)
TFS Power Tools (Visual Studio 2015)
Once installed:
Open Source Control Explorer
Right-click the item on which checkout is to be undone (or a parent folder of multiple files to be undone)
Select Find in Source Control and then Status
In the Find in Source Control dialog, leave the Status checkbox marked
Optionally, enter a value for the Wildcard textbox
Optionally, enter a username in the "Display files checked out to:" textbox and select that radio button
Click Find
This will result in a list of files
Select the items to undo
Right-click and select Undo
Click Yes when prompted with "Undo all selected changes?"
Team Foundation Sidekicks
Another option is to use the Team Foundation Sidekicks application, which can be obtained here: http://www.attrice.info/cm/tfs/
It has a Status sidekick that allows you to query for checked out work items. Once a work item is selected, there are "Undo pending change" and "Undo lock" buttons that can be used.
Rights
Keep in mind that you will need the appropriate rights. The permissions are called "Undo other users' changes" and "Unlock other users' changes". These permissions can be viewed by:
Right-clicking the desired project, folder, or file in Source Control Explorer
Select Properties
Select the Security tab
Select the appropriate user or group in the Users and Groups section at the top
View the "Permissions for [user/group]:" section at the bottom
I just had this problem myself and found an easier way to clean up old workspaces.
1) In visual studio, open source control explorer.
2) From the 'Workspace' dropdown select 'Workspaces...'
3) A dialog will appear showing the workspaces on your current PC. Select 'Show remote workspaces'
4) You will now also see workspaces from your previous PC (as long as they are from the same user account). Select the old workspace(s) and click 'Remove'. This should delete the old workspace from from TFS along with any persisting checkouts.
I'm sure Arne has found a solution but I hope this helps others who google the issue.
Command line
tf undo /workspace: OtherUserWorkspace;OtherUser $/TeamProject/MyFile.cs /s:http://YourTFSServer:8080
https://msdn.microsoft.com/en-us/library/cc470668.aspx
if you use the tfs power tools undo procedure above you need to do a get or get latest to update your screen. Otherwise it looks like undo has not worked.
The operation completed successfully. Because the workspace Workspace;domain\userID is not on this computer, you must perform a separate get operation in that workspace to update it with the changes that have been made on the server.

Resources