SVN keyboard shortcuts for Altium Designer

Menu_SVN (AD19)

Subversion is a great collaboration tool, particularly well suited to manage heavy and/or binary files. Thanks to a tight integration into the Altium Designer user interface, the use of Subversion (SVN) for Electronic CAD projects is quite straightforward.
But something is really missing: SVN keyboard shortcuts.

Altium Designer: Version control  essentials

Natively, there are several ways to interact with version-controlled files (see the documentation), but none of them really got my adoption:

  • They need many mouse clicks to achieve a simple task
  • Some of them seem “incomplete” to me (lack of features):
    • the “Version Control” dialogs are really too basics
    • operations involving external updates don’t reload the files from the hard drive, which I consider to be an integrity issue

I really needed something more “advanced”!

A new menu, with SVN keyboard shortcuts

New SVN menu with SVN keyboard shortcuts

I have developed a new drop-down menu dedicated to SVN frequent actions, right inside the Altium Designer menu bar. As you can see, each item has its own keyboard shortcut.

Standard installation

In order to have this menu too, you need to load some “Customizations” into your Altium Designer installation. Here is the standard way to proceed:

  1. Download the preferences file
  2. Open Altium Designer
  3. Open the “Preferences”
  4. Click “Import” at the bottom of the “Preferences” dialog box
  5. Browse to the file you have just downloaded
  6. Deselect all items but “System > Customizations”, just as in the screen capture below
  7. Restart Altium Designer
Load the SVN menu and SVN keyboard shortcuts customizations into Altium Designer

Note: The SVN menu is not available in all contexts. See the extended help for more details.

Icons and extended features

Now that you have the SVN menu with the SVN keyboard shortcuts, you may notice that the icons are missing. “TSVN” actions will also fail.
You need to do a bit more configuration:

  1. Create a folder named exactly “AltiumDesigner_AddOns” on your root drive C:\
  2. Create two other folders into “C:\AltiumDesigner_AddOns”: “MenuIcons” and “Scripts”
  3. Download the following content:
    1. https://github.com/Altium-Designer-addons/scripts-libraries/tree/master/UI%20customizations/Menu_SVN/Icons, and put it into the directory “C:\AltiumDesigner_AddOns\MenuIcons\Menu_SVN”
    2. https://github.com/Altium-Designer-addons/scripts-libraries/tree/master/Scripts%20-%20Misc/BetterRevertVCS, and put it into the directory “C:\AltiumDesigner_AddOns\Scripts\BetterRevertVCS”
    3. https://github.com/Altium-Designer-addons/scripts-libraries/tree/master/Scripts%20-%20Misc/TortoiseSVN, and put it into the directory “C:\AltiumDesigner_AddOns\Scripts\TortoiseSVN”
  4. Install TortoiseSVN (free and open source) to get the full potential of the TortoiseSVN script and menu

More help is available on the original GitHub wiki page.

Custom installation

IMPORTANT NOTE: Importing my preferences file may break any existing menu customization!
If you have already done some customizations, you are encouraged to edit your current DXP.RCS file (located in %AppData%\Altium\Altium Designer <GUID>\) by adding the content of my source file at the end of yours.

If you want the SVN menu to be available in even more contexts, you can extend the add-on following my instructions.

Using SVN keyboard shortcuts

As usual, any menu entry is accessible through:

  • Direct shortcut access, eg. CTRL + ALT + V
    • The shortcut is indicated at the right of the corresponding menu item.
  • Successive key strokes, eg. N > A > V
    • This is done by hitting the letters which are underlined (SVN > Advanced functions > Revert).

SVN extended features

What I call “extended features” actually come from scripts that I developed myself. If you are interested in writing your own scripts, or just curious about how they are built, I wrote an article just for you!

Commit/Update through TortoiseSVN

The “TSVN Commit folder” and “TSVN Update folder” menu items are special features that use a combination of a script TortoiseSVN.vbs and an additional program “TortoiseSVN”.

  • TSVN_CommitFolder:
    • uses TortoiseSVN and its nice Commit dialog box
    • acts on all the content of the project folder, not only the files contained in the Altium project
    • warns the user before committing if unsaved modifications are detected (everyone hate to forget to save a file just before a commit)
    • automatically refreshes the SVN status icons at the end of the operation
  • TSVN_UpdateFolder:
    • uses TortoiseSVN
    • updates svn:externals, if any
    • acts on all the content of the project folder, not only the files contained in the Altium project
    • blocks the update if unsaved modifications are detected on any file
    • closes and re-open all the project files that were previously open to be sure to work on the freshly updated files

Reverting files with confidence

The “Revert” function of the SVN menu in fact uses a custom script BetterRevertVCS instead of using the standard “VCS Revert” function of Altium Designer. In addition to effectively reverting the currently focused file, the script will close the file and re-open the freshly reverted version (which the native Altium function won’t do). This will prevent you to work on a file that has previously been reverted!

Developers only:
Want to be even more confident while reverting? You would better use TortoiseSVN in the background. If your installation of TortoiseSVN is configured to do so, the reverted files would be moved to the recycle bin instead of being definitely deleted.
If you want to explore this solution, you should try to edit the source code of the BetterRevertVCS script by replacing the line
Call ServerRunProcessSend("VersionControl:VersionControl", "ObjectKind=FocusedDocument|Action=Revert")
by something like
objShell.Run( TortoiseProc & "/command:revert /path:""" & GetWorkspace.DM_FocusedDocument.DM_FullPath & """" , 10 , True )

Being more efficient with TortoiseSVN

TortoiseSVN can really make you more efficient on everyday actions:

Create your own keyboard shortcuts

If you only want to extend my SVN menu, you can edit the DXP.RCS file to fit your needs.

You also have the ability to edit the toolbars and menus. To go ahead with that, I encourage you to read the official documentation.

WordPress Cookie Plugin by Real Cookie Banner