Tuesday, June 29, 2010

Short Post - Using non-Visual Studio editors with TFS - Part 2

Part 1

After checking some resources, there's a way to check-out (and check-in) files from TFS using the command line.

tf checkout FILENAME
tf checkin FILENAME

Tf.exe is not a program that is automatically added to the path, so you might have to add it by-hand (or include it in your Powershell profile file or whatever).

Because there's a command-line tool for TFS, there's a way to do this within from Vim. Kevin Berridge posted a great pair of Vim functions on his blog. There's a catch: if you happen to use Powershell.exe as your shell, this function breaks when the directory or file name includes parenthesis. I don't use any check-in function (I prefer using Visual Studio to check my changes before check-in), but here's my current version of the check-out function:
function! Tfcheckout()
    let filename=expand('%:p')
    let command='!tf checkout '
    exe command . "'" . filename . "'"
endfunction

Where's the emacs equivalent? I don't use emacs at work, and I don't use TFS at home, so I can't test it. This EmacsWiki entry might help you on your quest.

No comments:

Post a Comment