#46 support for svn > 1.7 from Mike Stupalov

git-svn-id: http://www.observium.org/svn/observer/trunk@3133 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2012-05-03 19:38:26 +00:00
parent 7bed89ebbc
commit c450f2aea9

View File

@@ -1120,12 +1120,18 @@ if (file_exists($config['install_dir'] . '/.svn/entries'))
} else {
// SVN version >= 1.7
$xml = simplexml_load_string(shell_exec($config['svn'] . ' info --xml'));
$svn_rev = $xml->entry->commit->attributes()->revision;
$svn_date = $xml->entry->commit->date;
if ($xml != false) {
$svn_rev = $xml->entry->commit->attributes()->revision;
$svn_date = $xml->entry->commit->date;
}
}
list($svn_year, $svn_month, $svn_day) = explode("-", $svn_date);
}
if (!empty($svn_rev))
{
$config['version'] = "0." . ($svn_year-2000) . "." . ($svn_month+0) . "." . $svn_rev;
} else {
# FIXME - $config['release'] not needed
$config['version'] = $config['version'] . "." . $config['release'];
}