Freigeben über


What is a Changeset?

Curious about the source control part of Microsoft Visual Studio 2005 Team Foundation? Tired of looking at feature lists and marketing hype? If so, here’s a word you can chew on for awhile:

changeset

When one of the hard-working developers on my team like Buck or James check in their code, their changes usually relate to a single developmental task or a small set of tightly-coupled tasks. I call these ‘task-specific checkins’.

More often than not, a task-specific checkin involves multiple, interdependent revisions to two or more files. Consequently, changes to a single file don’t usually make sense unless they are accompanied by thorough checkin notes, which of course they usually are because the Hatteras SDEs are the best of the best.

By inclination, training, and habit, software developers seem to reject the notion of performing tasks for which an automated alternative exists, or might someday exist.  They’re lazy, but smart lazy.  If you are a smart lazy developer, you are going to LOVE changesets in Visual Studio Team Foundation.

A changeset is a logical container into which VSTF bundles everything related to a single checkin operation. A changeset consists of:

  • source file and folder revisions (adds, renames, edits, deletes, moves)
  • related work items (bugs, etc)
  • system metadata (owner, date/time, etc)
  • checkin notes and comments

In a technical sense, a changeset is more than a logical container. A changeset is a version of the repository at a specific date and time.  Consequently, you can return your workspace (your personal view of the source control repository) to exactly the way it was when you fixed that pesky crashing bug sometime last month.  Oh! And it’s literally this easy to accomplish:

<C:\WS1> vstf Get /version:C349712

This command retrieves a working copy of all uncloaked files and subfolders from the repository to the local workspace with which the WS1 folder is associated as they were at the time when changeset #349712 was created!

When you’re done reflecting on the elegance of your bugfix, you can resync your local workspace to the latest repository version using the following command (assuming that WS1 is the root of the workspace).

<C:\WS1> vstf Get /recursive

Comments

  • Anonymous
    July 15, 2004
    Is the implementation of a changeset transactional, as it is in the excellent Perforce source control system?
    That is, either all or none of the files in a changeset are submitted.
  • Anonymous
    July 15, 2004
    Yes Tom, checkins are atomically committed and fully transactional. To put a fine point on it, changesets are the final product of the checkin process. A changeset doesn't exist until each and every file has been uploaded to the server. Prior to that time, we refer to the uncommitted entity as either a 'pending changeset' or 'pending workspace changes'.
  • Anonymous
    July 16, 2004
    Thanks. Your naming seems to follow perforce's closely, except they talk about changelists and pending changelists.
  • Anonymous
    July 18, 2004
    Oh, I am really very very disappointed about what you called "changedset". You may know MBF & ObjectSpace & SqlXml 2.0 use ChangeSet intensively in its kernel.

    I want to known some implementation detail and technique about "ChangeSet" in this meaning, how it compare to Fowler's Unit of Work.
  • Anonymous
    July 19, 2004
    Hao: FWIW, if you google on changeset you'll notice other source control systems (GNU Arch, Bitkeeper, etc.) using the same term. When possible (and it makes sense), we try to reuse existing, established terms in the source control realm to help ease adoption of Hatteras by customers. Source control is just a tool (we're just trying to be a very nice one :) and steep learning curves, especially when they're not necessary, are a waste of developer time and productivity. We're trying to save developer time (lots of it), so making up new terms is something we'd like to avoid.

    As Tom notes, "changelists" is also an option, but a quick google shows it's largely perforce-specific. That doesn't make it bad, but the google hit count is well over an order of magnitude less, so it is a less desirable choice.

    Of course, Korby is our final word on such decisions (and he's made excellent choices) so he may be able to explain better if there's still confusion.
  • Anonymous
    July 29, 2004
    This sounds very cool to me. I can't wait until we have the CTP pieces in our hands to try it out.
  • Anonymous
    September 14, 2005
    VSS provides IVSS automation interface to program. This interface is used to retrieve the information...
  • Anonymous
    September 14, 2005
    VSS provides IVSS automation interface to program. This interface is used to retrieve the information...
  • Anonymous
    March 04, 2007
    Is there any way to set the unique changeset number for collection of files which will be modified to fix a defect or implement a change request?