SVN properties

SVN allows to store some useful keywords which can be set, the value of which will be substituted for ‘tags’ in the file itself.

For instance, if the Id keyword is set, place this line in your code

__revision__ = "$Id: gendoc.py 2252 2010-02-08 17:43:10Z username $"

The string between $Id: and $ is going to be automatically replaced in the future by the proper Date, SVN revision and author. This is especially useful when you want to associate a revision with an executable.

Yet, most of the time the properties are not set. One way to do it is manually:

svn propset svn:keywords "Author Date Id Rev URL"  example.py

If you already have a bunch of files, just use a linux tools such as find:

find . -name "*py" | xargs svn propset svn:keywords "Author Date Id Rev URL"

Finally, if you create a file, again you have to set the properties. Hopefully, there is a configuration options that will automatically set the properties to the new added/commited files. Change the configuration file in ~/.subversion/config:

enable-auto-props = yes
[auto-props]
*.c = svn:keywords=Author Date Id Rev URL;svn:eol-style=native
*.h = svn:keywords=Author Date Id Rev URL;svn:eol-style=native
*.cc = svn:keywords=Author Date Id Rev URL;svn:eol-style=native
*.cpp = svn:keywords=Author Date Id Rev URL;svn:eol-style=native
*.py = svn:keywords=Author Date Id Rev URL;svn:eol-style=native
Please follow and like us:
This entry was posted in Computer Science, Linux and tagged , . Bookmark the permalink.

5 Responses to SVN properties

  1. hunter says:

    Dear Thomas,
    I found your interesting webpage while looking for python package using arma models on the web. Your package named timeseries looks very interesting for me, but unfortunately i was not able to find the way to install it. Can you please help me with that. Thanks.

    • admin says:

      Hi,

      Last month, I finally make it available on pypi. In principle, you should be able to type

      easy_install spectrum

      thanks
      Thomas

  2. Lorenzo Ferretti says:

    Dear Thomas,
    Having in the past studied the book “Digital Spectral Analysis”, of Marple, now I found very interesting your module “spectrum”. I installed it and successful tested some of your examples.
    But now I’m not capable to find the module “timeseries”. The installation of “spectrum” don’t comprehends also the installation of “timeseries”, as may appear in your precedent answer to the request of “hunter”.
    Please let me know how to proceed.
    Thanks.

    Lorenzo

    • Dear Lorenzo,

      The timeseries package is not part of spetrum. It is different and its status is much less mature than spetrum. As a matter of fact, I am not currently working on time series package at the momen but I’ll come back to it maybe later this year.

      cheers
      Thomas

Leave a Reply

Your email address will not be published.