January 2006 - Posts

"Check Out" doesn't mean Check Out

One thing that confused me quite a bit with Subversion and Team System is that check out doesn't really mean "check out" in the traditional sense, as in "I just checked that book out from the library".



Korby Parnell has a great explanation of Check Out, highlighting the differences in Check Out behavior between VSTS and VSS:

Visual SourceSafe Team Foundation
1. Gets the latest database version of the file -- or the pinned version, if it exists -- to your working folder.
2. Overwrites the working copy of the gotten file if, as is usually the case, one already exists and is marked Read-only.
3. Makes your working copy of the file writable.
Makes your workspace version of the file writable.

Yesterday, I was sitting in a Team Foundation usability review in which somebody suggested that we should change CHECKOUT to EDIT in order to make it clear to users that in Team Foundation, to check out == to make writable and nothing more.

Check out, in modern source control systems, has nothing in common with the library notion of checkouts. The real synonym for "Check Out" is "Hey, I might want to edit this".

So when you're looking at a bunch of VSTS project files in the filesystem, the writable files have been checked out. The read only files have not.

It's questionable whether that's even necessary. I wouldn't mind if VSTS left everything writable and then automatically reconciled all the files on disk periodically. That would make it a lot easier to change files outside the Visual Studio IDE.
posted by jatwood with 7 Comments

Team Build requires Team System installed on the server

Team Build is a seperate installation on the Team Foundation Server CD that offers automatic, integrated build functionality. With this service installed, you can use your server (or another server) as a dedicated build machine which automatically runs your MSBuild project script, logs everything, and dumps the binaries wherever you want.

It's primarily for on-demand building. It doesn't do scheduling, unfortunately, but there is a relatively easy way to set up automatic builds through the Task Scheduler. There's also a new continuous integration add-in from a Microsoft PM on Team System.

The Team Build install worked fine for me on the server, and it integrates nicely into the IDE:

Team Build is highly integrated with the rest of Team System: you can even select the various build numbers you generated as targets in your work items. And work items for bugfixes are updated with resolved build numbers automatically! Very nice.

However, I was surprised to find that I couldn't perform automatic code analysis as a part of my build because I hadn't installed any of the Visual Studio Team editions on our Team Foundation Server. Installing a client app on a server isn't exactly intuitive, but it's what you have to do.

So, for the record, to get full Team Build functionality, you must install a Visual Studio Team edition (probably Test or Developer) on your build server. The benefits of doing so are outlined in this blog post:

  • Team System Tests integration. Tests included in TeamBuild scripts will run.
  • Complete support of C++ projects. TeamBuild compiles only ‘ISO C++ applications’ and ‘Managed C++ apps (safe and pure mode). Installing VSTS or VSTT will bring the complete support for C++ compilation.
  • Compiling VS setup projects. MSBuild does not have native support for building VS setup projects. Users will need to choose ‘devenv’ command line to compile these projects.
  • Code Analysis Integration. Code Analysis (a.k.a FXCop) rules included in TeamBuild scripts will run.

In general, anything you can dream up in a MSBuild script should run, assuming the proper dependencies are in place on the server.

posted by jatwood with 7 Comments

Team System Email Notifications

On our current Microsoft projects, we have to manually send out emails when we perform builds or check in changes. How tedious!

In Team System, you can configure project alerts to send these kind of emails automatically via the Team, Project Alerts menu...

There are four email notification options available in a default install of Team System:

  • Alert when my work items are changed by others
  • Alert when anything is checked in
  • Alert when the build status changes
  • Alert when a build completes

Usually you'd send these notifications to a group alias like project.developers@company.com, but I sent them to myself for testing purposes. Here are a few (very) basic examples of what these emails look like in your inbox.

A build completes:

Anything is checked in:

My work items are changed by others:

I couldn't figure out how to trigger the "build status changes" email yet. I tried failing the build, but no email..

Note that the hyperlinks in these emails link back to the project SharePoint site that Team System set up for us, eg, http://teamsystem:8080/WorkItemTracking/Workitem.aspx?artifactMoniker=79.

posted by jatwood with 17 Comments

Branching and Merging

One of the key concepts in any source control system is branching. But why would you want to branch code? The Subversion manual has a great explanation:

Suppose it's your job to maintain a document for a division in your company, a handbook of some sort. One day a different division asks you for the same handbook, but with a few parts “tweaked” for them, since they do things slightly differently.

What do you do in this situation? You do the obvious thing: you make a second copy of your document, and begin maintaining the two copies separately. As each department asks you to make small changes, you incorporate them into one copy or the other.

You often want to make the same change to both copies. For example, if you discover a typo in the first copy, it's very likely that the same typo exists in the second copy. The two documents are almost the same, after all; they only differ in small, specific ways.

This is the basic concept of a branch—namely, a line of development that exists independently of another line, yet still shares a common history if you look far enough back in time. A branch always begins life as a copy of something, and moves on from there, generating its own history

You can create a branch in Team System through the Source Control Explorer. Simply right click the tree and select the Branch option:

In this case, I'm branching the latest version of the Demo Console App to "Sprint 2". I used the default naming conventions that VSTS provides. Once you branch, you must check in your changes for the branch to appear:

Once I commit the branch changes, I now have a branch under my main project:

 

I then opened a new instance of Visual Studio 2005 and selected File, Source Control, Open From Source control:

Simply highlight the new branch, then provide a new physical folder and click OK to load the newly branched project.

Our demo project is very simple; I quoted some merge sample code provided by James Dawson. Here's class1 in the parent branch:

    class Class1
    {
        
public Class1()
        {
            
//
        }

        
public int SomeMethod1(int x, int y)
        {
            
return x + y;
        }
    }

And here's class1 in the child branch:

    class Class1
    {
        
public Class1()
        {
            
//
        }

        
public int SomeMethod1(int x, int y)
        {
            return x + y;
        }

        
public int SomeMethod2(int x, int y)
        {
            return (2 * x) - y;
        }
    }

I then edited the parent branch with a bugfix in SomeMethod1:

    class Class1
    {
        
public Class1()
        {
            
//
        }

        
public int SomeMethod1(int x, int y)
        {
            
return x + (y + 1);
        }
    }

Now I want to propagate that critical bugfix in the parent down to the child branch I created. To do so, I right click the parent folder in Source Control Explorer and select Merge:

Pay attention to this dialog, because the order of the merge is critical. In this case I am merging the parent with the child, but you could certainly opt to merge child changes back into the parent branch, too. Or you could randomly merge with some other branch that has nothing to do with your code. Again-- be careful!

The merge has a conflict. We expected that, because class1 has changed in both the parent and the child:

We need to resolve the conflicts:

Usually you can automatically merge non-conflicting changes, but I couldn't in this case for some reason.

I could also opt to arbitrarily overwrite one version with another, but I really want to merge the changes. So I left "merge changes in merge tool" selected and clicked OK to launch the merge tool:

I then manually changed the method in the bottom (edit) pane to incorporate the change. I could have also clicked one (or both) of the changes in the top pane to automatically enter those changes in the bottom edit pane.

Once you're done, the merge changes are part of your changeset and must be checked in like any other changes. You can also opt to undo your changes if something goes wrong.

 

posted by jatwood with 7 Comments

What happens when you change files outside Team System?

Developers used to the CVS or Subversion source control model typically install the Tortoise shell extension that integrates source control directly into Windows Explorer:

 

While I fully expect that a similar shell extension will be available for Team System eventually, right now it doesn't work this way. If you want your changes to be tracked, you really need to make your edits inside the Visual Studio IDE.

What happens when you disregard this advice and change files under Team System source control outside the Visual Studio IDE?

  1. You'll have to remove the read-only flag on the files to change them at all.
  2. Once you make the change, the source control icons in the IDE show no visual indication that the file has changed. Nor does the Source Control Explorer. If you have the IDE open, it may prompt you to re-load the file, but the files aren't checked out*.
  3. Further edits to these files do not trigger automatic check out, which is a little strange to me.
  4. You must manually check out the modified files. But don't worry, your manual changes will NOT be overwritten by the latest version in source control.
  5. Once you perform a check in*, your modified files are finally committed to source control.

It would be nice if the IDE could at least mark changed files as edited and initiate the check out process for you on those edited files. But it doesn't. As it stands right now, if you edit files outside the IDE, it's a completely manual process

I recommend sticking to editing within the IDE. If you must edit files outside the IDE, do a global check-out of all files when you return; that way, when you check everything in, only the truly modified files will be committed to the repository anyway.

* By check-out and check-in, I do not mean the traditional Visual SourceSafe Lock-Modify-Unlock, but the first step of Copy-Modify-Merge. CVS and Subversion also use the check-out terminology this way, and it's confusing there, too.

posted by jatwood with 5 Comments

Team System Pricing: Buying a Steak at McDonald's

One of the hurdles Microsoft faces with Team System is that it's expensive relative to the other software Microsoft sells. Marc Wolfson, a Developer Evangelist at Microsoft, met with us recently at Vertigo and I thought he had a great way of explaining the pricing conundrum:

[Team System] is like walking into McDonald's and seeing prime rib on the menu for $20.

It could be the best prime rib you've ever had, but this isn't the kind of product or pricing you expect from McDonald's. That's exactly the challenge Microsoft faces with its customers-- why are you selling prime rib instead of burgers? And why is it twenty freakin' bucks?

At $10k per seat for the whole enchilada, and $5k per seat for the three task-specific editions, Team System definitely isn't cheap.

But consider how much Team System's competition costs. One comparable product is IBM's Rational Professional Bundle:

So you're looking at either $4k, $7k, or $12.5k per seat!  That puts Team System pricing in a whole new light.

But a lot of hamburger fans still think that they should get steak for the same price. Erik Sink debunks this myth:

A lot of Visual Studio developers in the "Professional" tier are complaining that they want the stuff in the "Team" tier.  In other words, they may understand that they are not the target market for Team System, but they are not happy about it.  They want source control.  They want bug-tracking.  They want unit testing.  Placing those features in the "Team" tier does not meet their expectations.  So they complain.

Microsoft is the largest software company in the world.  They are utterly dominant in some markets, but they are utterly irrelevant in others, including the market for enterprise-class lifecycle development tools.  It is important to realize that Microsoft is facing very difficult competition in this market.  They have some major catching up to do.  Success is not guaranteed.

If I were to advise Microsoft on how to fail in this challenge, I would tell them to try and please the enterprise customer and the folks in the "Professional" tier at the same time.  :-)

But Microsoft is smart.  They are designing a product to win and they are pricing it accordingly.  That is IMNSHO the right strategy for them.  Team System is already a lot cheaper than its competition.  If they priced it dramatically lower than it is now, the target market would not take it seriously.  Remember, the people in that target market already hold a negative view of Microsoft's ability to deliver this kind of product.

I believe Microsoft will succeed.  Team System is going to be an incredible product.  It raises the bar in a number of ways that I believe are truly unique.  It will take some time before it attains the level of polish and maturity now available with ClearCase, BitKeeper or Perforce.  But they will get there.

Perhaps someday Microsoft will bring some or all of the features in the "Team" tier to the broader market.  But right now I completely understand why they feel the need to stay focused.

Eric is a little biased since his company sells source control and bug tracking products that are perfect for those disenfranchised Visual Studio 2005 Professional developers. Even after factoring for bias, I think what he says has a lot of merit. Microsoft will eventually expand Team System downward to address these concerns, but right now Microsoft is focusing on the enterprise.

And can you blame them? If you priced your best steak at $3.99, exactly what kind of steak would you be expecting?

posted by jatwood with 3 Comments

FxCop with and without Team System

Unfortunately, Visual Studio 2005 Professional doesn't include any integration with FxCop, Microsoft's static code analysis tool. I guess I got spoiled by the beta versions of Visual Studio 2005 I was using, which were the all-you-can-eat Team Suite editions.

Fully integrated static code analysis (via FxCop) is only available in Team Developer and of course the Team Suite editions of Visual Studio 2005.

When static code analysis is enabled in your project properties, you'll see the various FxCop recommendations show up in the build output window:

Sure, it's a little naggy and overprotective, but it's a great reminder system. It's also infinitely configurable. You can disable any warnings you don't want, and even create entirely new rules for FxCop to evaluate.

I currently have "only" VS 2005 Professional installed with the basic Team System IDE plugin, so I'm using the latest standalone FxCop for .NET 2.0, version 1.35 beta 1. Unfortunately, you lose all the benefits of IDE integration that you get with Team System, such as right-clicking a rule to automatically apply the SuppressMessage attribute to your code.

Steve Michelotti documented a nice workaround that lets you use the SuppressMessage attribute with the external FxCop UI. You'll still have to copy and paste code from FxCop into the IDE, but it's better than nothing.

 

posted by jatwood with 2 Comments

Using a custom compare tool in Team System

I'm a big fan of Beyond Compare as a general purpose file and folder comparison utility. I can't recommend it highly enough.

So of course I want to use Beyond Compare as my default file compare tool in Visual Studio Team System:

Here's how:

  • In Visual Studio, select Tools, Options
  • Expand the "Source Control" tree and select "Visual Studio Team Foundation Server"
  • Click "Configure User Tools"
  • Click "Add"
  • Enter ".*" as the extension (eg, all files)
  • Enter "C:\Program Files\Beyond Compare 2\BC2.exe" as the path
  • Leave the params at the default of "%1 %2"
  • Click OK

Works great! This is also documented, along with dozens of other source control systems, on the Using Beyond Compare with Version Control Systems page at Scooter Software as well. They recommend using params of "%1 %2 /title1=%6 /title2=%7", however.

posted by jatwood with 4 Comments

TFS Release Candidate with "Go Live" license

I thought that Beta 3 refresh would be the last Team Foundation Server release with a "Go Live" license before the formal release, but it looks like that's not the case.

Jeff Beehler announced yesterday that TFS Release Candidate, coming in early February, will also have a "Go Live" license

While there will be a few known issues in this release that we still intend to fix, it’ll be very close to the final version.  As a result, we need your help in validating that we haven’t missed any big issues before we release the golden bits.  As I’ve previously explained, we’re only fixing the most critical of issues to help prevent regressions and your feedback is very important in helping us make these decisions. 

As with Beta3 refresh, this Release Candidate will be a ‘go-live’ release.  By this we mean that we’ll provide the tools you need to upgrade your data from Beta3 Refresh and we’ll support migrating your data from the RC to final release of TFS.  Please, please, please plan on upgrading to this release.  We need your feedback to help us make sure we’re ready to release the final bits and your real world, production usage is the best way for us to gauge this readiness.  We are still committed to releasing the final build of TFS in the first quarter of 2006. 

Sounds good to me-- there's certainly a lot to improve on in Beta 3 refresh ;)

posted by jatwood with 82 Comments

Troubleshooting failed project creation in Team System

We recently installed the Beta 3 refresh of Team System with the "Go-Live" license  here at Vertigo, with the intent of actually switching a few existing VSS projects over.

We've performed dozens of VSTS installs, so we have the process down to a science by now. There are three main server components in a VSTS install:

  • SQL Server 2005 (with Reporting Services)
  • Windows Sharepoint Services (with SP2)
  • Visual Studio Team System Server

Unfortunately, security settings are maintained independently across all three products:

One shortcoming of TFS is that when you add a new user to the system, the user is only created in the Team Foundation Server...not in the other two areas where the account needs to be created (in SQL Server and in Sharepoint).  This creates extra work for the administrator of the TFS...they need to go into Sharepoint and SQL and add the user, with the correct permissions, manually.  The Aftermarket Solutions team here has decided that we could build a tool that overcomes this obstacle...now we need to figure out whether or not customers really want this tool.

It's all too easy to forget to grant a user permissions in SQL Server and/or Sharepoint, try to create a project, and then the creation of the Team System project will fail. What's worse is that with Beta 3, the rollback of this partially-created project fails too! So you end up with these "zombie projects" that you can't kill.

Paul recently spent a lot of time troubleshooting a zombie VSTS project named "Tempus." This time, we forgot to grant Paul sharepoint permissions, so the project creation failed and (of course) also failed to roll back. We tried to recreate the project with the same name, but we kept getting "TF30321: The name you typed is already used for another team project on the Team Foundation Server." Curse you, zombie project!

We could use another name, but we really, really, wanted this one to be called "Tempus". I'll summarize what Paul found in his investigations.

  1. Microsoft's James Manning created the nifty utility ListTeamProjects, which lists all Team System Projects-- even the ones in a failed state. Here's what it looked like when we ran it:

    >ListTeamProjects TeamSystem
    
    All team projects (2):
    
    Vertigo.Tempus  vstfs:///Classification/TeamProject/(guid) [New]
    Test            vstfs:///Classification/TeamProject/(guid) [WellFormed]
    

  2. You can use the command line utility TfsDeleteProject to attempt to delete the project:

    TfsDeleteProject /force /TeamFoundationServer:TeamSystem Vertigo.Tempus

  3. In our case, TfsDeleteProject didn't work-- it said it couldn't find that project. A post by John Ship advised us to manually create a SharePoint site using the stsadm.exe command line interface:

    stsadm.exe -o createsite -url http://teamsite/sites/sitename -ownerlogin 
        domain\user -owneremail user@domain.com
    

    Once you do this, you have to navigate to the newly created http://servername/reports SharePoint site and use the New Folder command to create a folder that has the same name as the failed project. Then re-run TFSDeleteProject.

Sadly, none of these fixes worked for us. We got farther along, but we would still have to go into the SQL Server database and manually delete the records associated with this project. That's a bit too much of a hack for our tastes.

So we capitulated and created a new project with a different name, which worked fine. That means the zombie "tempus" project is still out there somewhere. Probably stumbling around looking for fresh brains..

Here's hoping Microsoft improves the project creation/deletion code in Team System to better detect and fix the failed project creation scenarios before RTM!

posted by jatwood with 6 Comments

TFS Source Control using the Console

I was helping out a fellow co-worker today to figure out a Team System problem when I found out that the old H.exe command (H for the Team System Source Control codename Hatteras) has now been renamed to TF.exe. We are using Team Foundation Server Beta 3 Refresh with the corresponding client piece. So, if you come upon the h.exe command in old documents, remember it's now called TF.exe!

What's so special about this command? Well it's the command line program to access the Team Foundation source control. Of course we have Source Control Explorer which is the graphical, user-friendly interface, but console geeks (like me ) still enjoy doing things by keyboard now and then. TF.exe can do everything Source Control Explorer can do including:

You can see the details of each of these commands by going to the Command Line Reference page or click on one of the commands above to go directly to the documentation page for that command up on MSDN. 

A couple of tips when using TF.exe:

  • TF.exe is installed as part of the TFS client. I could not find it on the server. TF.exe is located in the folder:

    C:\Program Files\Microsoft Visual Studio 8\Common7\IDE
    Assuming you used default folders when you installed the TFS client piece.

  • Whenever you run a command, you must specify the server. You can do this with the /server:[server_name] flag. For example, to view the files in source control on server TFS01, use this command:

    tf.exe dir /server:TFS01

    Assuming you have the correct permissions, the contents at the root of the source control should now be displayed. 
posted by ericc with 47 Comments

Why Linus Torvalds Hates Subversion

There was a dustup last year between the Linux Kernel development team and their chosen source control management system, BitKeeper. Kerneltrap has a great overview of the events:

BitKeeper was first utilized by a Linux project in December of 1999, when it was employed by the Linux PowerPC project. In February of 2002, Linux creator Linus Torvalds decided that BitKeeper was "the best [source control] tool for the job" and started using it to manage the mainline kernel, an event that received much attention in the free and open source communities, and beyond. BitKeeper, was created by Larry McVoy, who originally conceived of BitKeeper as a tool to keep Linus from getting burnt out by the growing task of managing the Linux Kernel. Since Linus began using the tool three years ago, the pace of Linux kernel development has doubled.

Unfortunately, due to differences in licensing and business models, Bitkeeper terminated their free product, which meant the kernel team had to choose another source control tool. Some people suggested that the Kernel team use Subversion. But Linus dismisses Subversion completely:

PS. Don't bother telling me about subversion. If you must, start reading up on "monotone". That seems to be the most viable alternative, but don't pester the developers so much that they don't get any work done. They are already aware of my problems ;)

Evidently Subversion doesn't map very well to the way the Kernel team works, as outlined in the article Please Stop Bugging Linus Torvalds About Subversion on the Subversion site itself.

Subversion was primarily designed as a replacement for CVS. It is a centralized version control system. It does not support distributed repositories, nor foreign branching, nor tracking of dependencies between changesets. Given the way Linus and the kernel team work, using patch swapping and decentralized development, Subversion would simply not be much help. While Subversion has been well-received by many open source projects, that doesn't mean it's right for every project.

It's really a cautionary tale in making sure the source control system you choose matches the way you work.* Linus waxes poetic about the productivity gain that BitKeeper's source control model provided to him personally, and the Linux kernel development team:

That "individual patches" is one of the keywords. One thing that BK has been extremely good at, and that a lot of people have come to like even when they didn't use BK, is how we've been maintaining a much finer-grained view of changes. That isn't going to go away. In fact, one impact BK has had is to very fundamentally make us (and me in particular) change how we do things. That ranges from the fine-grained changeset tracking to how I ended up trusting submaintainers with much bigger things, and not having to work on a patch-by-patch basis any more. So the three years with BK are definitely not wasted: I'm convinced it caused us to do things in better ways, and one of the things I'm looking at is to make sure that those things continue to work. So I just wanted to say that I'm personally very happy with BK, and with Larry. It didn't work out, but it sure as hell made a big difference to kernel development.

Not all source control models work for every development team. There is no One True Source Control Model. That's why it's a good idea to actually research the alternatives before picking one.

* And a little bit about open source business models versus commercial business models, but that's not germane to this post ;)

posted by jatwood with 1 Comments

Shelving and Branching

Team System offers an interesting "shelving" feature

Shelving lets you set aside any pending changes you've made to the source into a named shelveset. Once shelved, those changes are isolated from the main source tree. But that shelveset can be ..

  • shared with other users
  • worked on locally
  • integrated back into the source tree

.. at will. It's a handy feature!

Evidently the Shelving feature is very popular with the Team System development group at Microsoft:

[Shelving is] amazingly simple to use and as soon as the concept 'clicks', people start seeing how handy it is. It's become wildly popular for creating "fix ready" changesets for DCRs, bugs that need approval before checkin, feature work in progress but not ready to be committed, etc. I'm not sure the typical version control user is comfortable enough with branches to deal with many such branches being out there that they might want to interact with, particularly when they may be organized along multiple lines (by user for work in progress, by feature area for DCRs and bug fixes, perhaps).

Shelving in Team System is equivalent to creating a private branch in Subversion, as outlined in this post by Mike Mason:

  • Whilst working on adding the new “frobscottle” feature Alice decides she’d like to shelve her current working copy changes. Her project is checked out from svn://svn.acme.com/project/trunk.
  • Needing somewhere to store her changes, Alice branches the trunk to create svn://svn.acme.com/project/shelves/alice/frobscottle.
  • Alice uses the Subversion switch command to switch her working copy from the trunk to the new frobscottle branch. When switching, Subversion preserves any changes you’ve made to the working copy.
  • Alice checks in her working copy. The changes will be safely stored under the shelves directory.
  • Alice switches her working copy back to the trunk and works on something else. In future if she wants the shelved frobscottle changes she can merge from the branch to her trunk working copy, then commit the changes back into the main code line.

As you can see, Subversion relies pretty heavily on path conventions, such as

/project/trunk
/project/trunk/shelves/
/project/trunk/shelves/username/

When you set up a project in Subversion, you're supposed to manually create these root-level folders:

/project/trunk
/project/tags
/project/branches

Trunk is where the main body of your project code goes; tags and branches are simply straight copies of the tree with labels attached.

posted by jatwood with 6 Comments

Visual SourceSafe 2005 pricing and features

For some reason, Visual SourceSafe 2005 is only included with the Team System editions of Visual Studio 2005.

Why you would want to use SourceSafe when you have Team System is a mystery to me. VSS is not included with any other editions of Visual Studio 2005. You won't find a \vss folder in the Standard or Professional editions, and the Express edition doesn't even support source control binding through the IDE.

Whether it's bundled or not, Visual SourceSafe 2005 isn't free. Visual SourceSafe 6.0x has a MSRP of $549. Visual SourceSafe 2005 is also $549, and version upgrades from 6.0 run approximately half that.

This is the first truly new version of VSS in more than six years. The first thing you'll notice is that they finally brought the janky 1996 UI forward ten years:

It even supports standard file open and folder select dialogs at last! It always drove me crazy that I had to manually key in c:\documents and settings\ paths in VSS 6.

There aren't any really groundbreaking new features; it's still the VSS you know and er.. love.. but with many long overdue bugfixes and enhancements:

  • Maximum repository size increased to 4 gigabytes; archive limits increased
  • File retrieval operations are twice as fast
  • Multiple language and time zone support
  • Unicode text file support
  • Copy-Modify-Merge improvements
  • Extensible with managed code assemblies
  • Allows use of external diff and merge tools
  • Remote Web access over HTTP

The full list of new features is available in the Visual SourceSafe Roadmap document at MSDN. But the fundamental architecture of VSS is completely unchanged.

A VSS 2005 upgrade might be a reasonable option for shops that are totally committed to VSS and unwilling or unable to devote any resources to changing. But on a pure feature-per-feature basis, VSS 2005 certainly isn't competitive with any modern source control system.

posted by jatwood with 0 Comments

Exclusive Locks vs. Optimistic Merges

Developers weaned on Visual SourceSafe are used to the exclusive lock change model**:

  1. Lock the file
  2. Modify the file
  3. Unlock the file

Which looks something like this:

*

However, most modern source control systems (such as Visual Studio Team System, Subversion and SourceGear Vault) do not use this model by default. They use an optimistic merge change model:

  1. Copy the file locally
  2. Modify the file
  3. Merge your changes into the file

The main difference is that two developers can now work on the same file at the same time, as illustrated here:

*

The optimistic merge model is widely regarded as superior. It's more flexible. And most of the time, changes made to a file don't conflict and can be automatically merged. That's probably why it's the default model in most recent source control systems.

However, you still need exclusive locks for files that can't be merged. This typically means binary files such as word documents, image files, etcetera. So if you have any binary files under source control, you'll definitely want to make use of exclusive locking on those files.

All modern source control systems support both exclusive locks and optimistic merges, so you can have your cake and eat it too.

* Images reprinted from Version Control with Subversion
** It is possible to use the optimistic merge model in VSS, but most shops don't do this, and it isn't recommended by Microsoft.

posted by jatwood with 5 Comments

Team System Tips

I've been working with Team System and Team Foundation Server for quite some time now so I thought I'd share some tips that I have learned.

A bit of background, the first version of Team Foundation Server I worked with was July CTP. Back then, installation was horrible, and everything was just hard to do. Since then, things have improved drastically and setup has been much improved. That's not to say there aren't certain things I would like to see simplified, but it's getting there.

So here are some tips for working with TFS:

  • A couple of acronyms you will see commonly:
    VS2005, VS2k5 = Visual Studio 2005
    TFS = Team Foundation Server
    TE = Team Explorer
    VSTS = Visual Studio 2005 Team System
    WSS = Windows Sharepoint Services

  • Everytime I talk about TFS to newcomers, people are confused about how VS2005, VSTS, and TFS are related to each other. Once you know the basic differences, it's quite simple.

    VS2005 is the version of Visual Studio without all the new Enterprise features. VS2005 is just the IDE, compilers, and some tools strictly to build your applications.

    VSTS includes all the new fandangled features in addition to the features of VS2005 geared towards Enterprise developers. When I say Enterprise, I mean developers who create applications that need planning, design, and testing. Of course everyone could use these features, but it's mostly Enterprise developers who have the money to pay for these added features. There are 4 editions to Team System: Architect, Developer, Test, and Suite. As you might suspect, these editions are geared towards a user with a specific role, or the Suite edition which includes everything for the user who fills multiple roles.

    Finally TFS is the server product that brings Visual Studio 2005 (all editions) together. With an integrated work tracking, reporting, and of course a brand new source control system, TFS is what you need to install to get all your users linked together through a specific project process.

  • Team Explorer is the name of the client piece of Team Foundation Server. This is essentially a Visual Studio addin that allows VS to talk with TFS. If you have VS 2005 installed (any edition), then TE will integrate with your existing installation. However if you do not have VS 2005, then setup will install a VS 2005 shell for TE to install into. This allows you to work with all the functionality of TFS even if you are using another environment (ie. Visual Studio .NET 2003). 

Improvements I would like to see:

  • Integrated security manager. I'm sure everyone who tried TFS for the first time has encountered the problem where they could access TFS and the source control, but not the Sharepoint site. The answer is to this problem is a result of TFS being a cross-server platform. Not only do you have to configure your permissions for TFS, but you will also need to configure the permissions individually across the 2 other servers TFS uses: SQL Reports Server and Windows Sharepoint Server. Since these 2 are separate products with their own security design, TFS does not propogate security settings to those servers.

    Seems to me it wouldn't be too difficult to write a wizard that would make the security changes to TFS, then make the necessary changes to SQL Reports and WSS. Good news is according to this post, it looks like they're working on such a tool. In fact just last Friday, Rob Caron/Kannan Sundararajan announced a new TFS Permissions Manager Tool! Cool, can't wait! 

  • Better error messages in setup. Most of my installations of TFS have been pretty straight forward. However, certain instances where my installation failed, I would get weird, cryptic error messages. For example, one common error I keep getting when trying to install TFS on a certain server configuration is:

    The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 26105.

    Can anyone decrypt this error message? I've seen this error so many times that the number 26105 is now tattoo'd into my brain! Looking at the log files helped me pinpoint the error, but I still couldn't figure out the problem. A setup application similar to the new SQL Server 2005 would be great!

  • Rollback errors! This issue is just unacceptable. We tried to create a new team project but it failed someplace. Turns out our project is now in an "unfinished" state. The project appears to have not been created, but if we look in the security properties, the new project groups are there. There needs to be better protection against cases like this.

Team System encompasses a whole lot of new features so I've only scratched the surface here. If this is your first time learning about the features of Team System, definitely give it a try by downloading the demo of VSTS and/or TFS Beta 3 Refresh (from your MSDN subscription) or by reading up about it on the main homepage. Of course with any new product, there's bound to be some flaws. Hopefully all these issues I've encountered are just beta issues and the RTM release coming sometime soon will correct these!

 

posted by ericc with 0 Comments

Setting up a Subversion Server under Windows

I talked a little bit about what Subversion is in my previous post. Now, let's get it set it up in Windows.

Luckily for us, Joe White has done most of the work already; he has a tremendously helpful post that documents how to set up Subversion. I'll see if I can streamline his excellent post a bit further, and illustrate it with screenshots.

A) Download Subversion

You'll need the latest version of..

B) Install Subversion

  1. Unzip the Windows binaries to a folder of your choice. I chose c:\program files\subversion\ as my path.
  2. Now, add the subversion binaries to the path environment variable for the machine. I used %programfiles%\subversion\bin\

  3. You'll also need another environment variable, SVN_EDITOR, set to the text editor of your choice. I used c:\windows\notepad.exe

C) Create a Repository

  1. Open a command prompt and type
    svnadmin create "c:\Documents and Settings\Subversion Repository"
  2. Navigate to the folder we just created. Within that folder, uncomment the following lines in the /conf/svnserve.conf file:

    [general]
    anon-access = read
    auth-access = write
    password-db = passwd
    

    Next, uncomment these lines in the /conf/passwd file:

    [users]
    harry = harryssecret
    sally = sallyssecret

D) Verify that everything is working

  1. Start the subversion server by issuing this command in the command window:

    svnserve --daemon --root "C:\Documents and Settings\Subversion Repository"
    

  2. Create a project by opening a second command window and entering this command:

    svn mkdir svn://localhost/myproject
    

    It's a standard Subversion convention to have three folders at the root of a project:

    /trunk
    /branches
    /tags

  3. At this point, Notepad should launch:

    Enter any comment you want at the top of the file, then save and exit.

  4. You'll now be prompted for credentials. In my case I was prompted for the administrator credentials as well:

    Authentication realm:  0f1a8b11-d50b-344d-9dc7-0d9ba12e22df
    Password for 'Administrator': *********
    Authentication realm:  0f1a8b11-d50b-344d-9dc7-0d9ba12e22df
    Username: sally
    Password for 'sally': ************
    
    Committed revision 1.
    

    Congratulations! You just checked a change into Subversion!

E) Start the server as a service

  1. Stop the existing command window that's running svnserve by pressing CTRL+C.
  2. Copy the file SVNService.exe from the zip file of the same name to the subversion\bin folder.
  3. Install the service by issuing the following commands:

    svnservice -install --daemon --root "C:\Documents and Settings\Subversion Repository"
    sc config svnservice start= auto
    net start svnservice
  4. Test the new service by listing all the files in the repository:

    svn ls svn://localhost/
    

    You should see the single project we created earlier, myproject/

F) Set up the shell extension

  1. Run the TortoiseSVN installer. It will tell you to restart, but you don't need to.
  2. Create a project folder somewhere on your hard drive. Right click in that folder and select "SVN Checkout..."



    type svn://localhost/myproject/ for the repository URL and click OK.


  3. Create a new file in that directory. Right click the file and select "TortoiseSVN, Add"


  4. The file hasn't actually been checked in yet. Subversion batches any changes and commits them as one atomic operation. To send all your changes to the server, right click and select "SVN Commit":



And we're done! You now have a networked Subversion server and client set up on your machine. Note that the default port for svnserve is 3690.

For more tips on using subversion, take a look at the free O'Reilly Subversion book.


posted by jatwood with 39 Comments

Subversion: The "sequel" to CVS

Subversion is a sort of open-source "sequel" to CVS, the classic open-source version control system that dates back to 1989. The Subversion FAQ is very clear about this:

Why does this project exist? To take over the CVS user base. Specifically, we're writing a new version control system that is very similar to CVS, but fixes many things that are broken. See our front page.

And it seems to be very successful as a CVS replacement. Simon Tatham, the developer of PuTTY, switched from CVS to Subversion in late 2004 and has almost uniformly positive things to say about it:

I've described my experiences so far of migrating from CVS to Subversion, and using Subversion. In particular:

  • userv can be used to give Subversion a security model vastly superior to that of CVS.
  • FSFS is king, and permits anonymous access with a high confidence of security. This means Subversion 1.1.
  • Migrating from CVS is easy if you don't mind the way cvs2svn sets things up for you, but gets a lot more difficult the more perfectionist you get. However, if you only do it once it's worth putting some effort in!

Although I've described some issues above which might or might not be considered bugs in Subversion, in general they're easy enough to work around, and in most respects I think Subversion amply fulfills its promise of being ‘CVS, only done properly’. I like it, and I don't regret migrating. I'd do it again.

Subversion also won the 2005 Jolt Award for best Change and Configuration Management Tool:

Subversion provides an attractive alternative to expensive, high-end, source code management packages. Several features make it particularly appealing: Check-ins of multiple files are done as a single changeset, and check-ins of changesets are atomic—all modified files are checked in as a single transaction, or none of them are. Subversion rolls back a partially completed check-in should a problem occur. This step prevents incorrect versioning in case of a conflict or error. Subversion supports check-ins of entire directories as a single commit, which makes for facile updates of entire projects. It also supports the use of metadata—either text or binary—that can be associated with any and all files. Add easy, inexpensive branching and multiple networking protocols, and you have a winning product. On top of that, Subversion offers a server that's more portable than CVS and more functional than Windows, and that can run in stand-alone mode or as a module in Apache 2.x. All these goodies add up to the best version-control product on the market today. The fact that it's free and open-source is just a bonus.

The name Subversion is also quite clever. It reminds me of the Church of the Subgenius:

But getting Subversion set up in Windows is a little bit daunting. I'll cover how to do that in my next post.

posted by jatwood with 5 Comments

Comparing Visual Studio Team System Editions

I still get a little confused about all the different versions of Visual Studio Team System:

  • Visual Studio Team Architect Edition
  • Visual Studio Team Developer Edition
  • Visual Studio Team Test Edition
  • Visual Studio Team Suite

Team Suite is easy; it's the whole enchilada. You get all the features.

However, the other three editions are a bit more complex. I found this handy diagram which summarizes the contents of Architect, Developer and Test Editions: 

There's a core set of features (eg, Team Foundation), and then on top of that some features specific to the various Team Suite Editions:

Architect Edition

  • Application Modeling
  • Logical Infrastructure Modeling
  • Deployment Modeling

Developer Edition

  • Dynamic Code Analyzer
  • Static Code Analyzer
  • Code Profiler
  • Unit Testing
  • Code Coverage

Test Edition

  • Load Testing
  • Manual Testing
  • Test Case Management
  • Unit Testing
  • Code Coverage

Now, the obvious question: how much does it cost? Our MSDN Universal and/or Partner status spoils us developers when it comes to pricing.

But for regular customers, the various editions of Visual Studio 2005 break down like this, from least expensive to most expensive

Product Price Upgrade/Renewal
Express Free! Free!
Standard $299 $199
Professional $799 $549
Tools for MS Office $799 $539
Team Edition for Architects* $5,469 $2,299
Team Edition for Developers* $5,469 $2,299
Team Edition for Testers* $5,469 $2,299
Team Suite* $10,939 $3,499

* these prices include a MSDN Premium subscription.

It's unlikely you'd buy the "professional" editions without a MSDN subscription for each developer anyway. Plus, these MSDN subscriptions offer Visual Studio 2005 Professional as a perk:

Product What you get Price Renewal
MSDN Professional - VS 2005 Pro
- all operating systems
- SQL Server Developer Edition
$1,199 $799
MSDN Premium - VS 2005 Pro
- all operating systems
- all server products
- all productivity apps
$2,499 $1,999

You may notice that MSDN Universal and MSDN Enterprise do not appear here-- that's because they are being phased out:

With the launch of Visual Studio 2005, MSDN Universal and MSDN Enterprise subscriptions will no longer be offered for sale to new customers.

Active MSDN Enterprise subscribers will receive a no-cost upgrade to the MSDN Premium Subscription for the Visual Studio Team Edition for Software Developers. This subscription includes the prior benefits of an MSDN Universal subscription along with the Visual Studio 2005 Team Edition for Developers.

Each MSDN Universal subscriber will have a choice to upgrade, at no additional cost, to one of the three higher value MSDN Premium Subscriptions for the Visual Studio Team Editions for Software Developers, Architects, or Testers. These subscriptions include the benefits of an MSDN Universal subscription along with the appropriate Team Edition for Developers, Architects or Testers.

Until an MSDN Universal subscriber makes a transition choice, the subscriber will continue to receive existing MSDN Universal benefits until the end of the retail subscription or Volume Licensing agreement. MSDN Universal subscribers will not receive one of the Visual Studio Team System role-based products until a transition choice is communicated.

In addition to this, an existing Universal or Enterprise subscriber can upgrade to the "all you can eat" Team Suite edition for $2300, a very good deal indeed:

Universal subscribers that want all of the client functionality of Team System will be able to upgrade to Team Suite by paying just the incremental software assurance or renewal price for the duration of their agreement. In retail, this amounts to around $2,300 and for most customers this represents a 75% or more discount on the full price of Team Suite. Volume customers will, of course, pay less.

posted by jatwood with 8 Comments