Skip to content

Subversion and TextMate

subversion

TextMate

Another post in my series on subversion, a free, open source version control system:

Today we’ll look at three ways that subversion interacts with my favorite text editor, TextMate:

  1. TextMate’s subversion repository
  2. TextMate’s subversion integration
  3. Keeping local modifications to TextMate in sync across multiple computers with subversion

TextMate’s Subversion Repository

In Prefences → Software Update you can set TextMate to automatically check for updates (recommended). You can also set it to watch for cutting edge updates. Cutting edge updates add advanced functionality and some bundles require this setting. In a way, the label is misleading, since the cutting edge updates tend to be very stable. If, however, you want the bleeding edge of TextMate development, you will have to access TextMate’s subversion repository, http://macromates.com/svn/Bundles/trunk/. There you will find bundles, plugins, support files, themes, tools, and more. Instructions about how to checkout bundles from the subversion repository can be found in the manual (RTFM, baby), and the wiki. These should definitely be read. But above all check out Haris Skiadas’ excellent tutorial.

TextMate’s Subversion Integration

TextMate, like other advanced editors on OS X such as BBEdit and Aquamacs, enjoys subversion integration. So instead of working with subversion from the command line or with a subversion front end like svnX, it is possible to work with subversion directly from your text editor. ⌃ ⇧ A brings up a menu with common subversion commands. If you have opened your working copy as a TextMate project, then selecting the root of that directory and selecting `status’ will bring up an HTML window with the output of the command:

svn status

Click on the thumbnail below for a picture.

svn status

As you can see, the HTML window not only shows the relevant files and their status, but it allows you to perform certain actions—you can add, revert, diff, and commit. The diff command displays line differences—not great for prose, as I have emphasized here and here. Fortunately, selecting commit brings up the following dialogue window:

svn commit

Notice that you can diff from here as well. However, this will use whatever diff program you have assigned as the value of the shell variable

TM_SVN_DIFF_CMD 

in Preferences → Advanced → Shell Variables. Setting the value of this variable to fmdiff will allow you to display word differences graphically in FileMerge.

Keeping TextMate in Sync

One of the great things about TextMate is how easily configurable it is. Even if you are not a programmer, after a while you will find yourself writing snippets, commands, and maybe even entire bundles. Suppose, however, you work on more than one machine—say, at home and at work. It would be great if you could keep these local modifications in sync. (Frustration is an essential tab trigger that works on one but not another copy of TextMate.) Fortunately there is an easy solution. Just commit:

~/Libray/Application Support/TextMate

and

svn up

will keep you up to date on whatever machine you are on.

{ 1 } Trackback

  1. Parting Observation at Excursus | May 18, 2007 at 3:49 pm | Permalink

    […] Subversion and TextMate […]

Post a Comment

You must be logged in to post a comment.
FireStats icon Powered by FireStats