Welcome Guest Donate | Search | Active Topics | Members | Log In | Register

Using Team Foundation Server source control system Options
lingy
Posted: Thursday, November 19, 2009 11:31:06 AM

Rank: Administration
Groups: Administration , Member

Joined: 5/8/2009
Posts: 1,576
Points: 5,631

Shelving and Unshelving Pending Changes

Sometimes, developers may need to set aside their current work or move on to other tasks before the files are ready for check-in. For instance, you may be in the middle of working on some code files when an urgent bug is logged that requires your attention. Or perhaps you haven’t quite completed a required code change before leaving on vacation. In these scenarios, you don’t want to check in your work because it is incomplete. You also don’t want to leave the work checked out locally onto your box for what may be a lengthy period. Shelving allows you to take some or all of your pending changes and store them back into the TFS source repository database without checking them in.

Shelving Files

Shelving works in a similar way to the check-in process, and is handled by the Shelve window. To open the Shelve window, you can click on the Shelve button in the Pending Changes window, or you can click on the Shelve Pending Changes button in the Source Control Explorer. Alternatively, you can use the Solution Explorer: Right-click on a file and select Shelve Pending Changes.

To shelve folders and files from Source Control Explorer

  1. In Source Control Explorer, right-click, and click Shelve Pending Changes.

  2. In the Shelve - Source Files dialog box, type the shelveset name, for example shelvetest in the Shelveset name box.

  3. In the Comment box, type Testing my shelveset, and then click Shelve.

    The files and folders are copied to the source control server and are available for other team members to unshelve.

To shelve folders and files from Solution Explorer

  1. In Solution Explorer, right-click, and click Shelve Pending Changes.

  2. In the Shelve - Source Files dialog box, type the shelveset name, for example shelvetest in the Shelveset name box.

  3. In the Comment box, type Testing my shelveset and then click Shelve.

    The files and folders are copied to the source control server and are available for other team members to unshelve.

To shelve pending changes from the Pending Changes window

  1. In the Visual Studio 2005 Team System integrated development environment (IDE), click View, Other Windows, and then click Pending Changes.

  2. In the Pending Changes window, click Source Files, and then select the files you want to shelve.

  3. Click Work Items, and then add or remove work items.

  4. Select or clear the Preserve Pending Changes Locally box.

  5. Click Shelve.

  6. In the Shelve - Source Files dialog box and type a name in the Shelveset name box.

  7. Type a comment in the Comment box, and then click Shelve.

When you shelve your code, you are creating a shelveset, which is identical to a changeset but applies to shelved code only. You will be prompted to name your shelveset so that it can be retrieved later.

Unshelving Files

After a shelveset has been created, you have the option to unshelve that shelveset at any point in time. This will return all the shelved files into your workspace. Click on the Unshelve button in the Pending Changes window to launch the Unshelve window. All your previously created shelvesets will be visible; you simply select the one you want and click the Unshelve button.

  1. In Visual Studio 2005 Team System, click File, point to Source Control, and then click Unshelve.

  2. In the Owner name box, type the shelveset creator's name (for example, ADVENTUREWORKS\JuanGo or simply juango) and then click Find.

  3. In the Results pane, select the shelveset you want to unshelve into your workspace, and then click Details.

  4. If you want to delete the shelveset from the Team Foundation source control server, deselect the Preserve shelveset on server option.

  5. Optionally deselect the Restore work items and check-in notes option if you do not want to have the work items and check-in notes associated with the shelveset restored.

  6. When the Details dialog box appears, select the shelveset or shelveset items you want to unshelve into your workspace, and then click Unshelve.

Unlike the Get operation, which merges reconcilable differences between two versions of a file automatically and helps you merge conflicts manually, the unshelve operation does not support merges. By removing shelved pending changes from your workspace at the commencement of the code review, you can be assured that any changes your reviewer makes to the shelveset, such as adding comments to a file, do not create merge conflicts during the unshelve process.

Sponsor
Posted: Thursday, November 19, 2009 11:31:06 AM


lingy
Posted: Thursday, November 19, 2009 11:35:13 AM

Rank: Administration
Groups: Administration , Member

Joined: 5/8/2009
Posts: 1,576
Points: 5,631

Perform a Get Latest operation to synchronize your workspace with the latest server version and then build your application to ensure that it compiles prior to shelving or checking in. Doing so gives you an opportunity to incorporate changes to source files that have been made outside of your workspace.

lingy
Posted: Friday, November 27, 2009 9:46:42 AM

Rank: Administration
Groups: Administration , Member

Joined: 5/8/2009
Posts: 1,576
Points: 5,631

How To Customize Process Methodology

Methodologies in Team Systems are defined as process templates. A process template is a set of files that Team Systems can use to define a given process or methodology. As we have discussed, Team Systems ships with two process templates: MSF for Agile and MSF for CMMI. You use the Process Template Manager to modify a process template. This tool lets you export a process, tweak it, and then reimport it. You can access this tool from Team Explorer. The following figures show the menu structure for accessing the tool.

The Process Template Manager saves all the files that define the process to a folder upon download. This folder contains XML files that define a lot of the process. It also contains the default documents, queries, and process guidance associated with the methodology.

Suppose that you want to customize the Bug work item. You want to add a field to indicate bug type. This will allow the person triaging bugs to categorize them.

To make your edits, you again would export a methodology. For this example, use the one you exported previously (CMMI). You then navigate to the work item type definitions (\WorkItem Tracking\TypeDefinitions). This folder contains definitions for each work item defined by the process. Of course, you are interested in the Bug.xml file.

This definition file contains the core fields defined for bugs as well as common fields that apply to most work items. The definition is long and does not bear repeating here. You will add your new field to the core fields area in this XML.

<FIELD name=”Bug Type” refname=”Unleashed.BugType” type=”String”
reportable=”dimension”>
<HELPTEXT>Represents the type of bug</HELPTEXT>
<REQUIRED/>
<ALLOWEDVALUES>
<LISTITEM value=”Error”/>
<LISTITEM value=”Requirement”/>
<LISTITEM value=”Change”/>
<LISTITEM value=”Navigation”/>
<LISTITEM value=”Text”/>
<LISTITEM value=”Cosmetic”/>
</ALLOWEDVALUES>
<DEFAULT from=”value” value=”Error”/>
</FIELD>

This field is added to the Fields section of the XML. Notice that you restrict the values that can be entered in this field by using the AllowedValues node. This will tell Team Systems to display this field as a drop-down list for users. This field is also marked as required (<REQUIRED/>) and has a default value set using the Default element. Finally, the field definition indicates that the field is reportable. This tells Team System to include this field when doing analysis for reports.

You must also define how the field should appear on the form. You do this inside the Form section of the XML. You want the field to appear at the top of the form to the right of the Title field. To accomplish this, you add a column to the Group element that contains the Title field.

<Group>
<Column PercentWidth=”70”>
<Control Type=”FieldControl” FieldName=”System.Title” Label=”&Title:”
LabelPosition=”Left”/>
</Column>
<Column PercentWidth=”30”>
<Control Type=”FieldControl” FieldName=”Unleashed.BugType” Label=”&Bug Type:”
LabelPosition=”Left”/>
</Column>
</Group>

Finally, you upload the new process template. The following figure shows the results of this work.

 

Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.


© 2010 Canaware Solutions. All rights reserved.
Powered by Canaware Forum version 2.4