|
|
Do you wish Emacs had TFS integration? This is a start.
tfs.el is elisp code that provides emacs functions that do basic TFS tasks. The tasks include: checkout, checkin, status, history, diff, properties, get, undo.
If you use emacs, and also use TFS, you probably want to try this out. It's really easy to use.
Next steps:
Team Foundation Server is Microsoft's team development and version control server product. It is nicely integrated with Visual Studio. The Team Foundation Server product also includes a command-line client tool that can connect to the server to perform basic tasks.
Many people use both Visual Studio and emacs when working on .NET projects. Visual Studio has invaluable designers, unit test capability, red squiggles, and many other useful features. On the other hand, Emacs is sometimes much more productive for editing a set of code files all at once, because of its macro support, buffer handling, kill and yank, abbrevs, and so on.
Integrating Emacs with TFS provides obvious benefits. It means you can visit a code file in emacs, then, with a few keystrokes, check it out from TFS and begin editing. You can revert (undo) changes, and release locks. You can perform diffs, and do other basic TFS tasks.
Of course, you can also do all of these things within Visual Studio, using the Source Control Explorer or context menus. The key point is, you can do the TFS work from either environment.
| function | default key binding | description |
| tf checkout | \C-x v o | checkout the file currently being visited. |
| tf checkin | \C-x v i | checkin edits for the file currently being visited. |
| tf undo | \C-x v u | undo (discard) edits for the file currently being visited. |
| tf diff | \C-x v d | diff current file against the latest checked-in version |
| tf rename | \C-x v r | rename the current file |
| tf delete | \C-x v - | delete the file currently being visited, from source control |
| tf add | \C-x v + | add the file currently being visited, into the source control system |
| tf history | \C-x v h | detailed history of the file currently being visited |
| tf status | \C-x v s | status of the project - which files have pending changes. |
| tf get | \C-x v g | get the latest version of the file currently being visited, as a readonly copy |
Theoretically, you should be able to connect to a TFS server from any machine, Windows or not. but I don't have any machine, I have a Windows machine. And I don't know if there's a command-line tool for TFS available on non-Windows platforms. If you know of one, let me know!
It shouldn't be hard to build, as TFS exposes a web services interface between client and server, and third parties have already produced clients using Java.
If you are inspired to build any of these things yourself, or if you would like to collaborate on the work, please Send me a message.
These are the steps to setup tfs.el for use:
(require 'tfs)
(setq tfs/tf-exe "c:\\vs2008\\common7\\ide\\tf.exe")
(setq tfs/login "/login:domain\\userid,password")
(global-set-key "\C-xvo" 'tfs/checkout)
(global-set-key "\C-xvi" 'tfs/checkin)
(global-set-key "\C-xvp" 'tfs/properties)
(global-set-key "\C-xvg" 'tfs/get)
(global-set-key "\C-xvh" 'tfs/history)
(global-set-key "\C-xvu" 'tfs/undo)
(global-set-key "\C-xvd" 'tfs/diff)
(global-set-key "\C-xvs" 'tfs/status)
(global-set-key "\C-xvr" 'tfs/rename)
(global-set-key "\C-xv-" 'tfs/delete)
(global-set-key "\C-xv+" 'tfs/add)
That's it for setup.
To use it, visit a file that is under source-code-control with TFS. Then use the key-bindings to do your TFS things.
Emacs has a "pluggable" version control subsystem, implemented in vc.el, which can support numerous "back ends", including GIT, SVN, CVS, RCS, SCCS, and more. There was even, once, a basic Visual Source Safe integration done.
I wanted to produce the tfs backend for vc.el, but I could not find a clear statement of what was necessary in order to plugin to vc.el.
The overall job seemed fairly straightforward to me: run the tf.exe commands necessary for checkout, checkin, and so on, via emacs keybindings. This required the creation of a few emacs functions. But the vc.el code was pretty opaque to me. And I found no documentation guiding me on how to add a new backend to vc.el.
It's been done before, so I know it's possible. I just couldn't figure out how to do it cleanly.
I actually spent more time trying to figure out vc.el, than I did actually implementing the "unintegrated" TFS capability available in today's tfs.el.
The TFS integration for Emacs (Emacs+TFS, referred to as "the software" in the text below) is an add-on to Emacs that provides integration with Microsoft Team Foundation Server. Emacs+TFS and its documentation is distributed under the Microsoft Permissive License, which is spelled out below. This license is also included in the tfs.el file.
Microsoft Permissive License (Ms-PL)
Published: October 12, 2006
This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.
Wanna help? Got questions? Suggestions? Contact me
(click for a printable page)