1 / 34

The Busy Developer’s Guide to Team Foundation Server 2010 Version Control

The Busy Developer’s Guide to Team Foundation Server 2010 Version Control. Brian A. Randell Senior Consultant MCW Technologies brianr@mcwtech.com | @ brianrandell | mcwtech.com/blogs/ brianr /. Version Control. Core component of Team Foundation Server (TFS)

ady
Télécharger la présentation

The Busy Developer’s Guide to Team Foundation Server 2010 Version Control

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The Busy Developer’s Guide to Team Foundation Server 2010 Version Control Brian A. Randell Senior Consultant MCW Technologies brianr@mcwtech.com | @brianrandell | mcwtech.com/blogs/brianr/

  2. Version Control • Core component of Team Foundation Server (TFS) • #1 reason why teams move from Visual SourceSafe to TFS • TFS Version Control will store any type of file • Files as large as 64 GB tested by Microsoft • Other terms used • Source Code Control • Revision Control

  3. Core Version Control Clients • Windows, OS/X, and Linux clients • Primary Windows Client is Team Explorer in Visual Studio • Team Explorer Everywhere provides Eclipse Integration and non-Windows platform support • TF—Command-line available on supported OSes

  4. Team Explorer • Runs as Visual Studio Package • Requires devenv.exe shell to run • Exposes Source Control Explorer window

  5. Other Clients • TFPT.EXE—Power Tool command line tool in Windows • Windows Shell Integration—also a Power Tool • Team Web Access—Read-only view from supported browsers • MSSCCI Provider—legacy client support on Windows • .NET API for custom clients

  6. Server • Team Foundation Server 2010 • Supports workgroup and domain mode security • Windows File System style ACL security • New logical model • A server has one or more Team Project Collections (TPC) • A Team Project Collection has one or more Team Project • Version Control factored by Team Project • Similar in concept to a repository in other products

  7. Basic Workflow

  8. Workspace • A workspace stores a mapping between an endpoint in the version control repository and a location on your client workstation • A workspace is identified by • Its name • The client computer on which it is created • The user account who created the workspace • You can have multiple workspaces on a client workstation • tf.exe workspace to edit | tf.exe workspaces to list

  9. Workspace Mapping

  10. Add • Put a file under version control for the first time • Creates a pending change • tf.exe add from the command-line • Can also use drag and drop from file system to SCC Explorer

  11. Pending Change • Modifications to a file that exist in your workspace but have NOT been committed to version control • Includes files being added • Can be committed via Check-In • Changes can be reversed via Undo Pending Changes • tf.exe status to view pending changes

  12. Check-In • Commits changes to repository • Optionally • Provide comments • Link work items • Add check-in notes • Supports policy enforcement to require above items • tf.exe checkin from the prompt

  13. View History • Every time you commit a file a new version is created • TFS is a “time machine” that lets you go back and see all the changes made to an item • You can view the history for a single file or a whole group • tf.exe history opens dialog

  14. Changeset • All check-in operations are atomic • A changeset represents a unique point in time in the version control repository and has TPC-level unique ID • Check-in operations can encompass multiple operations • Check-in of source code • Check-in related meta-data (comment, user, date/time, etc.) • Associate work items • Add check-in notes • Validate check-in policy

  15. Checkout • Default for most source files is shared checkout • Reduces contention for files • In the 2008 release, get latest on check-out added as team project level option—is this a good thing? • Auto-merge handles most changes where users are working on discreet areas—is this a good thing? • Three-way visual merge lets the “human” decide when auto-merge isn’t possible or when auto-merged shouldn’t be used • Can perform exclusive check-out when necessary

  16. Checkout lock types • TFS support three types of locks for a check out • None—Allow shared checkout • Check Out—Prevent others from checking out and checking in • Check-In—Allow others users to check out but prevent them from checking in (the anti-social lock)

  17. Compare • Can compare contents of files across time • Can compare structure of source tree • Server to local path • Local to local path • Server to server path • Can control point in time • tf.exe folderdiff from command-line

  18. Label • Let’s you tag or snapshot an item or set of items in the repository so you can at a later time get those items back from that point in time • Can be secured • Cannot be audited • TFS does not retain a history of changes made to the label

  19. Get • Request items from TFS be copied down to a workspace • Get Latest • Get Specific Version

  20. Conflict Resolution • Concurrent development without exclusive locks is good • However, possible to have conflicts • TFS 2010 provides new Merge item in channel • tf.exe resolve to start process from command-line • Let’s review from earlier • In the 2008 release, get latest on check-out added as team project level option—is this a good thing? NO • Auto-merge handles most changes where users are working on discreet areas—is this a good thing? NO • Three-way visual merge lets the “human” decide when auto-merge isn’t possible or when auto-merged shouldn’t be used

  21. Shelving • Shelving allows you a way to save changes to the server, without checking in • It provides for interrupted workflow • It provides for team review • It provides easy transfer of work between workstations • For example: home to work

  22. Shelving Example

  23. Cloak • Hides a section of your repository from your workspace • Reduces workspace clutter • Reduces download time during get operations

  24. But wait there’s more …

  25. Rollback • Rolls back the effects of one or more changesets to one or more version-controlled items • Does not remove the changesets from an item's history • Creates pending changes in your workspace that negate the effects of the changesets that you specify • In 2008, part of Power Tools • In 2010, built-in BUT only at command-line • tf.exe rollback

  26. Working Offline • TFS is a centralized version control system • Version control operations require access to server • Can work offline from Visual Studio • Open solution under version control; will be prompted to work offline • When access to server is back, tell VS to back online

  27. Policy • Client supports policy validation • Guides developer to on team standards for check-in • Policy controlled on per Team Project basis • Four built-in policies, more in Power Tools • Can write your own policy assemblies http://msdn.microsoft.com/en-us/magazine/cc163320.aspx→

  28. Gated Check-in • No more build breaks with Gated Check-in • Guarantees no code ever gets in that doesn’t meet at least some “Done” criteria • Uses shelving to run private build • Reconcile workspace if build is a success • Fix code if build fails—nothing checked in in this case

  29. Tips • Configure path structure right away • Configure security • Consider common workspace structure • Always manage workspace via tools—no Windows Explorer! • Get latest before check-in; watch auto-merge • Ensure Visual Studio bindings are correct • Install the Power Tools (lots of yummy goodness) • Consider removing resolve option from your work items

  30. Reference Links • MSDN Library Version Control Documentation • http://msdn.microsoft.com/en-us/library/ms181368.aspx • TFS 2010 September Power Tools • http://visualstudiogallery.msdn.microsoft.com/en-us/c255a1e4-04ba-4f68-8f4e-cd473d6b971f • TF.EXE: List of Commands • http://msdn.microsoft.com/en-us/library/z51z7zy0.aspx • Operations Available Only From the Command-Line • http://msdn.microsoft.com/en-us/library/ms194957.aspx

  31. Thank you!

  32. Session Evaluations Tell us what you think, and you could win! All evaluations submitted are automatically entered into a daily prize draw*  Sign-in to the Schedule Builder at http://europe.msteched.com/topic/list/ * Details of prize draw rules can be obtained from the Information Desk.

  33. © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

More Related