TFS shortcut to compare a modified file with the latest version - tfs

Right now I have to pull up Pending Changes window, right-click on the file and select Compare->With Latest Version... Is there a faster way to look at my modifications?

Keyboard Shortcut for doing TFS Compare
In the Team Explorer window under Pending Changes:
shift + enter on file
will compare the files
shift + double click on file
will compare file in background
Create visual studio mapping for the commands:
Set the shortcut for compare folder under Source Control
Explorer, you should set the shortcut keys for File.TfsFolderDiff
command.
Set the shortcut for compare specific file under
Source Control Explorer, you should set the shortcut keys for
File.TfsCompare command
Note: To set the keyboard shortcuts, open "Tools > Options". In the dialog that opens, go to "Keyboard". Example:
Note: The folder compare shortcut is only valid from the "Source Control Explorer". It is the same as right clicking in the "Source Control Explorer" and selecting "Compare...".
References:
Keyboard shortcut for File Compare?
Comparison keyboard shortcuts for Pending Changes in TFS by Alex Meyer-Gleaves.
How to Double Click to Diff Pending Changes in TFS by Richard Banks
TFS Shortcut to do a diff on all modified files with latest version

You can switch the double-click behaviour in the pending changes window to do a compare with latest by changing a registry setting:
Path: HKCU\Software\Microsoft\VisualStudio\<ver>\
TeamFoundation\SourceControl\Behavior
Value: DoubleClickOnChange (DWORD)
0 == view as the primary command (default)
1 == compare as primary command
You can find more information here:
How to Double Click to Diff Pending Changes in TFS.
A comment on that post also shows the entry to set if you want to use a shortcut key to do the comparison instead.

You can add hotkey bindings for TFS context menu commands, which may be an approach that will work for what you need.
Go to Tools > Options > Keyboard. In the 'filter' field, type 'TFS' and it'll show a list of all TFS commands that you can bind hotkeys to. The Source Control comparison ones can be shortlisted with "CompareWith". I've bound hotkeys in this way to the pending changes window's context menu, which is a great timesaver versus working your way down that tortuous context menu, but there may be other options that suit your needs better.

Another alternative could be to set up an alias in Command Window and use it. To bring up the compare window:
Open Command Window (ctrl + alt + A)
Set alias for File.TfsCompare
alias diff File.TfsCompare
Next time you need to do the compare, type 'diff' and hit enter in the command window. 'diff' is an alias name, could be set to whatever of your choice. If you want to delete alias, use
alias aliasName /d

Related

TFS 2012 Build Definition/Template - How to set Build Quality Automatically?

I thought this would be pretty straight forward, but it looks like the template has to be modified. Anyone have any idea what to do to add this piece to the default template?
I know how to edit the templates, I just don't know what I need to do to make this work.
This case already provided a solution for your requirement:
Copy the DefaultTemplate.xaml to DefaultTemplateCustom.xaml and open it
Click the Collapse All link in the top right corner
Open the toolbox and locate the Assign activity. It is located in the Primitives section
Drag the Assign activity to the end of the workflow, after the "Run MSBuild" activity
Go to the properties window. Set the "To" parameter to BuildDetail.Quality. Set "Value" to "xxx (Build Quality)"
Locate the InvokeMethod in the toolbox and drag it and drop it after the Assign activity
Set the "Target Object" to BuildDetail. Set "MethodName" to Save
Save the build definition xaml file and check it in, then build with the customized definition.
You can also consider to create a powershell script to set the build quality via TFS API and then invoke this powershell script in your build template. Refer to this link for details: PowerShell and TFS: The Basics and Beyond.
Here is a simple script to set the build quality:
$builduri = "vstfs:///Build/Build/1";
$collectionurl = "http://xxxx:8080/tfs/xxx/";
$tfs = [Microsoft.TeamFoundation.Client.TfsTeamProjectCollectionFactory]::GetTeamProjectCollection($collectionurl);
$buildservice = $tfs.GetService([Microsoft.TeamFoundation.Build.Client.IBuildServer]);
$build = $buildservice.GetBuild($builduri);
$build.Quality = "Released";
$build.Save()

copy element from one dgn to another dgn

Is there an equivalent command in microstation for the copyclip with basepoint from autocad to copy an element from one dgn to another dgn?
I tried attaching a reference and copying it that way, but then I can not detach that reference.
I get an error message about not being able to detach a model from a managed model.
Well, have you considered using the FF (FILEFENCE) command?
As you can see from the help topic it can be used in batch processing.
In short, you place a fence around the content to be saved to another file and then in the command window:
ff=<path_to_new_dgn>
Then, once you have your file, open the other DGN, and attach this new file as a reference.
Now go into the reference manager and right-click the attachment. Choose Merge to Master
Now the contents will be part of your DGN file.
Select the element(s) you want to copy.
Set a tentative snap point on the basepoint about which you'd like to copy. To set a tentative point, the default key is middle mouse button. If that button is not assigned, see this link.
Menu Bar > Edit > Copy
Open the drawing you'd like to copy into.
Menu Bar > Edit > Paste
Ensure your settings in the "Paste from Clipboard" dialog box are correct (angle, x scale, y scale).
Click where you'd like to paste.

How can I clean the Parameters field in the Run -> Parameters menu?

I'm using the CodeGear RAD Studio IDE.
In order to test my application with command line parameters I used a few times the "Parameters" field in the "Run -> Parameters" menu.
But every time I provide it with a new value, it could not be deleted from the "dropdown box".
I need to clean this field (erase all the values), since in some cases there is information on them that I don't want to share with people that occasionally could use my machine.
How can I clean this field?
The Delphi 2007 Parameters list is stored in the Windows registry in the HKEY_CURRENT_USER\Software\Borland\BDS\5.0\History Lists\hlRunParameters location
To clean that list remove the ItemN entries and set the value of the Count key to 0.

Where does Visual studio 2010 Checked-in items in Registry Editor?

I'm using TFS.
My problem changing the path "Debug>Options and Settings>Source Control>Environment" where is the Registry Editor.
example:
i change check box "Show deleted items in the Source Control Explorer" in change the
"HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\TeamFoundation\SourceControl\ShowDeletedItems data value change False in registry editor
but i change combo box" checked-in items -> Saving or Editing " the value. I am not found in registry editor. where is it in registry editor ?
All the values you are after, reside under "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\SourceControl".Those settings are generic for VS and apply regardless of the SCM used. So, it makes sense these don't reside under "..\TeamFoundation..".The following is a mapping of reg-value names against their representation in VS:GetFiles >> Get everything when a solution or project is openedCheckInFiles >> Check in everything when closing a solution or projectSilentCheckOut >> Display silent check out command in menus
KeepCheckedOut >> Keep items checked out when checking in
SaveUncheckedOut >> Checked-in items / Saving
CheckOutOnEdit >> Checked-in items / Editing
AllowInMemoryEditing >> Allow checked-in items to be editedThe items found in the dialog "Source Control"\"Visual Studio Team Foundation Server" obviously apply only when SCM is TFS.

How can I find all of the labels for a particular TFS project sub-folder?

Assume there is a TFS project Project with the subfolders trunk and 1.0. trunk contains the latest version of the application code for this project and 1.0 contains the code for the same application for the released version of the same name.
There are labels for both sub-folders and all of the labels include files in only one of the sub-folders. [You could also assume that the labels are recursive on a specific (maximum) changeset for all of the files in the entire sub-folder too if that simplifies your answer.]
How can I create a list of labels for one of these sub-folders, using Visual Studio, the TFS tf.exe command line tool, or any other tool or code that is publicly (and freely) available.
Note – I've written T-SQL code that queries the TFS version control database directly to generate this info, but I'm curious whether there are 'better' ways to do so.
In Visual Studio, in the Source Control Explorer window, right-click the sub-folder for which you want to list the relevant labels and pick View History from the context menu. In the History window that should appear, there should be a sub-tab Labels (as highlighted below) that lists labels applied to that sub-folder (but not specific items in that sub-folder).
To find labels in Visual Studio
Open Source Control Explorer.
In Source Control Explorer, open the shortcut menu for the collection, team project, branch, folder, or file that you are looking for.
Select View History. You will see a new window with all the Changesets.
Select Labels in the tab menu as highlighted in the below image.
I needed to do this on the command line today so here is a batch file that hopefully does the same thing (we've only just started using TFS and have limited labels on folders to test the OP's requirements).
You'll need to edit the collection parameter to tf to whatever your setup is, and possibly provide the login details depending on how your authentication is done.
#ECHO OFF
SETLOCAL EnableDelayedExpansion
#REM Check required parameters
IF [%1]==[] GOTO :usage
tf labels /owner:* /format:detailed %2 /collection:http://server:8080/tfs/collection > labels.txt 2> nul
SET CURRENT_LABEL=
FOR /F "tokens=1,2,3" %%G IN (labels.txt) DO (
IF [%%G]==[Label] (
SET CURRENT_LABEL=%%I
) ELSE (
IF /I [%%H]==[%1] (
ECHO !CURRENT_LABEL!
)
)
)
DEL labels.txt
GOTO :eof
#REM Subroutines
:usage
echo tfs_labelsforfolder - Display all labels that are applied to a folder.
echo.
echo tfs_labelsforfolder ^<folder^> ^[label_filter^]
echo.
echo folder - The folder to show the labels for, e.g. $/Project/folder
echo label_filter - Search pattern to use in tf labels command.
echo.
GOTO :eof

Resources