Software Mechanics
Why do we even have that lever?

Working offline with TFS

February 28, 2008 18:09 by Chris

At p&p, we use Microsoft Team Foundation Server for work item tracking and source code control. This comes as a surprise to exactly zero people I'm sure. Laughing

TFS did take some getting used to, but after working with it for a while it's gotten pretty comfortable. At least while I'm in the office. There's one nagging problem with it; when I go home, or out of the office, I've got to have corpnet access to work on the project. TFS tracks on the server which files you're editing, which means that even working on a local copy without doing a checkin requires access to the TFS server.

While I do have remote access, it's a pain, it's slow (I live about three miles beyond the borders of civilization, apparently, and my home can't get real broadband service), and at times unreliable. I've resorted to turning all the read-only bits off locally, editing away, then using the Team Foundation Power Tools uu and online commands to get synced back up.

This worked, but I hate working without a net. I still want source control, even just for local projects. And the tfpt commands get really confused if you delete files, so I needed a way to track that somehow, other than a pad of paper.

I just came up with an idea that I'm trying out, and thought I'd share.

I've been playing for a few months with a new open source source control system called Bazaar. It's intended as a distributed version control system where people ship patches to each other and it help manage the merges and whatnot (kind of like GIT). It's highly portable and plays nicely on Windows (unlike GIT). You do need to be comfortable at the command line, but that's not a problem for me. One of the nicest things for my purposes is that there's no server to set up. Each working tree is it's own working repository. You just type "bzr init ." and you've got source control on that directory. No need to set up a Subversion server, for example. And sharing my branches are as easy as emailing a file. Not that I've done that yet; this was just for me.

Anyway, back to the point. Here's what I'm doing. First, I made my TFS workspace into a bazaar repository as well. This means that as I make changes in TFS, bazaar will treat them as changes to the working copy, and I can check them into bazaar too. Second, I created a separate bazaar branch for my offline work. This gives me local source control; as long as I'm working in my local branch, I don't need to be connected to TFS at all.

Here's the money shot. Bazaar supports easy merging between branches. When I'm ready to commit to TFS, I push my changes from my local branch back to the TFS bazaar branch. Then I check that into TFS. Similarly, I can do a "get latest" in TFS, check into the master bazaar branch, then merge those changes into my local copy.

It's not quite seamless (I still need to play with tfpt to get the checkouts set up right) but so far it's working out a LOT better than working completely disconnected from source code control. Having local source code control makes this work a lot more agile; I can freely delete and modify stuff locally, check in or even branch some more, and I don't have to push back up to the server until I'm ready.

So far this system has been in use for about four hours, but so far so good. I'll update later once I've got more experience with it.


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Related posts

Comments

February 29. 2008 00:42

Craig

I've been using Bazaar for a few years now and I love it. I even use it in a similar manner with FolderShare: work in a working directory, then merge to a FolderShare library to distribute. Works a treat, and goes right through corporate firewalls. Smile

Craig

March 3. 2008 05:35

mark

Actually I do something very similar except that I do use GIT on windows instead of bzr. The msysGit http://code.google.com/p/msysgit/ version works very well and is under active development. Performance is not as fast as on linux of course but its quite acceptable except for git-svn which is still very slow.

mark

March 7. 2008 10:35

emrobi

Very cool. I've been experimenting with GIT but it's been painful on my Windows machine. Based on your experience, I'm going to give Bazaar a try.

emrobi

April 1. 2008 00:23

melborp

Interesting. With new TFS2008 you can take your project offline and do the development offline and then when your online, you can take it back online and it will add the changes to TFS. This has worked fine for me.
Of course when doing local development, not inside work envirnment, you can setup your own system like subversion. I dont know bazaar.

melborp

April 4. 2008 15:58

Chris

The new TFS "offline" support is just the TFPT online command rolled into the client. It's still pretty anemic.

Chris

Comments are closed