Powershell and Subversion

I'm busy playing around with Powershell, looking particularly at using it to write hook scripts for Subversion. Scott Hanselman has an approach using the NSvn library that comes with AnkhSvn. I will need to look at that approach a bit more in depth, but what impresses me about Powershell is its handling of XML.

Those who know SubVersion will know that one of the aims of the Subversion team is to make the output of the command line tools human readable as well as machine readable. So for most tools, you can format the output of tools like svnlook as text or as XML. Formatting as XML gives a great integration point for Powershell.

Here is a one-liner that will get the revision number of a working copy:

([xml](svn info 'Working Copy' --xml)).info.entry.revision
Published Sunday, October 01, 2006 12:54 AM by trumpi
Filed under: ,

Comments

No Comments