Main / Personal projects / Accurev Eclipse Plugin

Eclipse is a pluggable Java IDE. AccuRev is a proprietary Java based version control system with much better branch support than CVS, and that has hierarchical version control. However its command line interface and tool integration was not as good as CVS when I used it in 2003.

I used Accurev in 2003 when I was working for LifeHarbor. It’s proprietary software so I haven’t used it since I left industry. These days I primarily use Subversion, with a little bit of Quilt mixed in.

Eclipse can rename Java files and packages, changing all the code that depends on the classes. It is more than just a search and replace: it lets you rename a file or package in one operation, changing the file, the type name, all dependent classes, and even the imports. It’s addictive.

Unlike CVS, AccuRev directly supports renaming files and directories. However it doesn’t let you do it “after the fact”; it actually renames the file in the file system. If you renamed the file with Eclipse, there is no way to notify AccuRev about the change, besides defuncting the old file and reading it under the new name.

AccuRev now has a proprietary Eclipse plugin of their own, which presumably does this and much more. However their plugin is proprietary software, so I’m leaving this page up for people who want to use as much free software as possible. (My plugin is released under the GPL.)

It only supports accurev move. It doesn’t call keep, add, promote, defunct, or anything else. It works by a runtime exec call to accurev, but appears to work on both my Windows 2000 and Gentoo GNU/Linux boxes.

If the accurev rename fails (for example if you renamed an external file or if the computer is offline), it silently renames in the filesystem, and you have to manually synchronize it with accurev later.

Follow these steps to install the plugin:

  1. Download the plugin.
  2. Unzip it to your eclipse/plugins directory. plugins should be a directory next to your Eclipse executable.
  3. Make sure the accurev executable is in your path.
  4. Restart Eclipse and open the project. The project must already be managed by AccuRev. All commands will be run from the project root directory.
  5. Right click the project in the package explorer and go to Team/Share Project....
  6. Chose "Accurev" for repository type.
  7. Now when you rename a file or package in that project, Eclipse will call accurev move as appropriate.

This plugin also includes an action that adds a log4j field to the top of the class, that you can bind to a shortcut key. It inserts the following text at the top of the class (where <class> is the right class):

private static Logger sLogger = Logger.getLogger(<class>);

You have to restart the Java perspective after installing the plugin for new actions to become available. Restarting Eclipse won’t do it.