Alice in changesets

Published 12 April 05 05:47 PM | Adam Singer 

In our last episode, we discussed the checkin process. Of course, checking in changes isn't the end of the process; it's really just a new beginning. Changesets represent discrete points in time and can be used refer to a specific state of the repository. As such, you use changesets to specify a particular version of files and folders.

From the command line, if we want to see changeset 10, we run h changeset 10. This brings up the "changeset details" dialog, which looks very similar to the checkin dialog. Since we already exhaustively looked through all the tabs and options here, suffice it to say that all the data is in the same place, only now it's a record of what was checked in. However, we're able to update the checkin comment and checkin notes if we're either the person who checked in originally or a project administrator.

One of the very exciting features of the changeset dialog is the "compare" functionality. For each item, we have the option to compare with the previous version (if it existed before), with the last version we downloaded ("workspace version"), or with the latest version. You can also view an item or get its properties, as seen here.

We should also here elaborate on the fact that since changesets are defined to be atomic, they represent a snapshot in time of the entire repository. Even if a file wasn't changed in a particular changeset, it still has a discrete version that existed when the checkin occurred. Suppose, for example, a file "Progam.cs" was modified in changesets 7 and 14. Running h get Program.cs /version:C10 will get us the most recently changed version of Program.cs before changeset 10 (in this case 7).

As we noted in our discussion of the checkin process, a changeset can be associated with a work item. Suppose, however, that you want to create an association after the initial checkin. You navigate to the particular bug, task, etc, and then go to the "Links" tab. From here, you can link to a changeset. What if you don't know the changeset number offhand? We'll get to that in a moment.

Let's say you're trying to "Get specific version..." on a file or folder from within Visual Studio. Choose "Changeset" in the "version" dropdown, and then you can enter or search for a changeset number. Also, you can apply a label to an item as of a particular changeset number.

Searching for changesets brings up the "Find Changeset" dialog. In this dialog, we can search with several different options. We can specify a particular file or directory (wildcards allowed), particular users, and then search for all matching, only those between two changesets, or only those between two dates (inclusive). For example, we could do this or we could try this. In this dialog, we can resort the results as well as get details on the individual changesets.

That's all for now. Tune in next time, (hopefully not too far in the future) when we delve into the history command!

Filed under:

Comments

# Rob Caron's Blog said on April 15, 2005 6:17 AM:
Visual Studio Team System
I’ve kicked-off a series of posts that I’ve dubbed “A Hitchhiker’s...
# Adam Singer said on April 15, 2005 12:22 PM:
A follow-up question from my most recent post- How often do you think you'll want to edit the comments...
# Pablo said on June 20, 2005 2:44 PM:
Very interesting article. One question though,
is there a way to compare two changesets or labels (2 different states of the repository) to obtain only the files that were changed in between?
# Pablo Rincon said on June 27, 2005 2:01 PM:
Is there and easy way to get only the files/folder that were changed between two changesets?

Thanks
Pablo
# Adam Singer said on August 5, 2005 2:43 PM:
Pablo-

Apologies for the delay, apparently it no longer e-mails us when new comments are posted and it turned off "anonymous" posting. I've reenabled all posts, so that should help at least a bit.

As for comparing an entire changeset or label, at present there isn't a way to compare all files. However, individual files can be compared from any version spec to another. For example, to compare the version of file a.txt from label 'label1' to changeset 10, run "h diff a.txt;Llabel1~c10" (soon to be "tf diff...").

Also, within the changeset details window (opened from the command line "changeset" command or from the history window on an item), you can right-click on items and compare with previous version, tip version, or workspace version. This may help at least a little, though it's not complete solution.
New Comments to this post are disabled

About Adam Singer

Faster than a speeding batch file, stronger than a well coded C# library, Adam is often seen testing those dark, dank quagmires of features where few tread and even fewer return. And he does so with a signature chipper attitude not sold in stores.

Search

This Blog

Syndication

Page view tracker