Working "Offline" under Team System
Team System is a server-oriented source control system. When you check out a file, the client queries the server at the time of checkout. Ditto for rename, delete, etcetera. Obviously, this presents a huge problem if you're disconnected from the server. There's no server to check with!
Does this mean work grinds to a halt on your local workstation if your network or internet connection to your Team Foundation Server goes down?
Well, not quite, but it does become a little more labor intensive.
If you're planning to go on a trip, or you have some other scenario where you know you'll be disconnected from the server at a specific time, you could check out the entire solution prior to going offline. Since Team System uses shared checkouts, this isn't as bad as it sounds. But it's still kind of a chore, and you have to remember to do the checkout while you still have server connectivity.
If you forget to do a full checkout-- or in the unfortunate event of a network outage-- you can still get work done, but you need to be careful how you do it.
- Obviously, you'll need to turn off source control in the IDE. You certainly don't want a server query to a nonexistent server every time you start editing a file. That'd be painful!
- Remove the read-only flags from the files you edit. All files under TS version control are marked read only by default until they're checked out from the server. We have no server to connect to, so we have to do this ourselves. The IDE will prompt you to do this as you edit files, so you don't have to do it manually.
- Avoid renaming files. It's difficult to tell a rename from a delete (of old name) and add (of new name) without additional context provided by the command. So avoid the problem by avoiding renames.
Now the good news. The Team Foundation Power Toy (tfpt) has an "online" command which makes this process a little easier.
If you've worked offline, you can execute
tfpt online
in the local filesystem folder, and the power toy will do the rest. Note that it does not pick up deletes by default, because that incurs a lot of extra server traffic. If you deleted files, be sure to run
tfpt online /delete
To pick up your deletes as well.
After the tool runs, all your edits, adds, and deletes (but NOT renames) will be added as pending changes. It's up to you to check in your changes.
That's typical usage; here's the complete command-line reference for the tfpt online command:
When away from the network you may edit files without pending the necessary
changes to the server. tfpt online pends edits, adds, and optionally deletes to
files you have changed. You should not rename files when offline.
Usage: tfpt online [/deletes] [/adds] [/noprompt [/preview] [/nuke]]
[/exclude:filespec1,filespec2,...] [filespec...]
[/recursive]
/adds Checks with the server to see if any files in your
workspace are new and pends adds
/deletes Checks with the server to see if any files in your
workspace have been deleted and pends deletes
/noprompt Operate in command-line mode only
/exclude:filespec... Files and directories matching a filespec in this list
are excluded from processing
/recursive Switch from one level of recursion to full recursion
filespec... Only files and directories matching these filespecs
are processed
Options usable only in /noprompt mode:
/preview List the files and changes to which changes will be
pended without making changes
/nuke Instead of pending changes to the matching files not
currently in version control, deletes them from disk
You have to download the giant Visual Studio 2005 SDK (~300mb), which is still in beta at the time of writing, to get a copy of the TFPT utility. For convenience's sake-- and to avoid a giant, unnecessary download-- I am temporarily hosting a local copy of the TFPT tool and documentation here (308 kb) for anyone who needs a copy.