Using/Accessing SVN Keywords in Procedure Files

This is an example of the empty coding I use at the headers of my procedure files to allow SVN keywords to be considered at each commit cycle. Note the careful placement of spaces after the keyword: and before the $.

// Package Name
// $Author: $
// SVN History: $Revision: $ on $Date: $


This is an example of the same for an actual package after a commit cycle.

// Scroll Traces
// $Author: Jeffrey J Weimer$
// SVN History: $Revision: 1088 $ on $Date: 2009-07-08 14:55:06 -0400 (Wed, 08 Jul 2009) $


Note, for some reason, the Author keyword never has been substituted. I put it in manually for each procedure file and it stays in place. This may be a MacOS issue and/or something that I need to define somewhere in the SVN config file itself.

Here is an example of how to have the Revision string returned by a call to a function.

// About Me

Function/S AboutMe()

    string aboutme 
    aboutme = "This package is currently at development " + " $Rev: $ by $Author: $"   
    return aboutme
End
The only drawback is that, in Windows, procedure files are locked for writing and so the version control software (e.g. TortoiseSVN) cannot update the version numbers in the procedure file headers until Igor quits.
I had not really considered this for version control of procedure files already open and/or running in Igor.

An additional caveat is, you must set the SVN properties of the .ipf file itself to include the corresponding keywords (Author, Rev, Date ...). Otherwise, the information in the (text) procedure file will not be patched during a commit cycle.

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville

Forum

Support

Gallery

Igor Pro 8

Learn More

Igor XOP Toolkit

Learn More

Igor NIDAQ Tools MX

Learn More