Search code examples
phpsvnversion-controlrevision

How to get the revision number of external repository?


I have an PHP application on server example.com and I want to get the current revision of the svn-repository on host yyy.com without doing a checkout. How can I do this with PHP?


Solution

  • I will not speak to php, but you can check the revision from the info command

    $svn info --xml http://missing-link.googlecode.com/svn/ant-http
    <?xml version="1.0" encoding="UTF-8"?>
    <info>
    <entry
       kind="dir"
       path="ant-http"
       revision="91">
    <url>http://missing-link.googlecode.com/svn/ant-http</url>
    <relative-url>^/ant-http</relative-url>
    <repository>
    <root>http://missing-link.googlecode.com/svn</root>
    <uuid>34b72901-9e55-331d-4c20-7e8f93cd33ee</uuid>
    </repository>
    <commit
       revision="91">
    <author>[email protected]</author>
    <date>2011-08-19T12:41:43.691034Z</date>
    </commit>
    <lock>
    <created>1970-01-01T00:00:00.000000Z</created>
    </lock>
    </entry>
    </info>