index > Team Foundation Server - Version Control > get latest on checkout macro

get latest on checkout macro


We just started using team system, and were switching over from vss. We're used to the vss get latest on check out way of working. I know there's a million reasons given as to why this is taken out in team system...but our team wants it to work the regular way (it's to the point where superiors will can the product if a workaround isn't found). It's currently our only draw back to fully using team systems for all internal projects.

I posted the macro mentioned on other posts to accomplish this functionality below. My question is how do you set this up to work? Does it work automatically when you check a file out? Do you have to bind it to a button that you hit when you check it out? Any help or solutions will be greatly appreciated.

Sub

gleason78

Yes, you can add this macro to you toolbar or menu item. To do it,

- Go to Tools\Customize...

- On Commands tab, select "rearrange commands"

- On preferred toolbar or menu, click on "Add" and choose "Macros" in cateogory and add your macro.

To add a macro, there is Tools/Macro command. You can also click "record a macro" and do this getlatest & checkout operations to get a template of macro which you can edit later.




http://blogs.msdn.com/narend
Naren Datha - MSFT

Is there any way to get this to happen automatically whenever i check out for edit now? Like can i attach to the check out event in visual studio somehow? It'd be great if it worked with check out on edit.


using the macro does wierd stuff (i set it up). Like if you check out a file that has not changed, it gives you an annoying window that tells you that.

Another thing that would be passable, is a simple warning on checkout that the file is different on the server. I noticed in the output window it says this. Is there any way to make the alert more noticeable?

gleason78
I see "GetLatest on Checkout support" in current MSSCCI plugin - http://blogs.msdn.com/edhintz/default.aspx


http://blogs.msdn.com/narend
Naren Datha - MSFT
Can you use the msscci plugin within visual studio 2005? Will you lose any functionality doing this?
gleason78
You cannot use Msscci provider within VS2005, it's intended for other IDEs (VB6, VC6, VS2003 and others).


Michal Malecki
Michal Malecki
gleason78 wrote:

Is there any way to get this to happen automatically whenever i check out for edit now?

Not in the v1 client. The MSSCCI plugin has this feature, and future versions of Team Explorer may support it as well, but the macro is the closest alternative in today's shipping code. You could use UI automation, I suppose, but that's likely to be more effort than it's worth.

Richard Berg MSFT

Try this:

Public Sub DocumentEvents_DocumentOpening(ByVal DocumentPath As String, _

ByVal Read_Only As Boolean) Handles DocumentEvents.DocumentOpening

Dim attr As FileAttributes

attr = File.GetAttributes(DocumentPath)

If (attr.ReadOnly) Then

DTE.ExecuteCommand("File.TfsGetLatestVersion")

End If

End Sub

Paste it into the EnvironmentEvents window in Macro Explorer, just under the automatically generated code and save.

Now every time you open a file that is not read only (i.e. not checked out) VS will automatically get the latest version.

Hope this helps

Enzo

erard
reply 8

You can use google to search for other answers

 

More Articles

TFS Permissions
URGENT: Error when merging changes after folder move
VSTS Dev edition and TFS - IDE Locks on Add Item - BEEPS
Modest request regarding refreshes
Error checking out files "user cancellation occurred"
Force a compile on check-in
Checkin policy dll is blocked after the policy usage
How to establish CMM baselines for items under source control?
many applications sharing framework projects, and each on a diffe...
Problems moving TFS from Domain A to Domain B
Welcome to Bokebb   New Update   Joins the collection  
 

New Articles

Evaluating Check-in Policies during Shel…
Subfolder overwrite issue in Team System…
TF53010
tf get latest to a specific location
Migration error TF60096 - false alarm??
New TFS VersionTree addin
Source branching questionnaire
Migrations from 2003 to 2005
VSTS and database object version control
How does the OverlayIconIndex property o…
File Date in TFS-VC
TF MSSCCI Provider on 64Bit Windows Server
Error while migrating 2 folders
TFSVC API - Workspace.Get and GetOptions…
BUG: Checkin of binary file not detectin…

Hot Articles

Check In Policy to ensure that code builds
Branching bound projects and solutions d…
Version Control on documents
Branching from a labeled version after a…
Problem with source control (Data is Nul…
Get specific version not working after m…
Trouble using both VSS and VSTS
Trying to move source causes weird error
Is there a Starteam to TFS migration tool?
Files scrambled after VSS migration
How does the OverlayIconIndex property o…
Massive confusion here...
How team system supports baseline contro…
Difference between two Labels?
How-to Remove or reattach TFS Version Co…

Recommend Articles

MSSCCI 2003 Install Question
Forward integrating (parent-to-child) bu…
Source Safe Conversion Issues
Permanently de-branch files/folders???
Visual Source Safe -> Source Control …
Web Project: Projects have recently been…
TFS Proxy returns error in the middle of…
One big team project, or Eight small ones?
Date Time Field in Source Control Explorer
How to get the content of changeset usin…
New Team Foundation Server MSSCCI Provid…
Problem moving source from one server to…
VB6 mssci provider
"retiring" or locking a branch…
IDE does not open my main form automatic…