0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-11-08 06:48:42 +00:00

Add some more release scripts.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1033 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang 2007-05-05 22:40:51 +00:00
parent f4e4c1556d
commit b3a599e8c2
3 changed files with 61 additions and 0 deletions

26
release2-strict.php Normal file
View File

@ -0,0 +1,26 @@
<?php
// Merges in changes from trunk to strict branch
// WORKING COPY MUST BE POINTED TO STRICT BRANCH
require 'svn.php';
$svn_info = svn_info('.');
$last_rev = (int) $svn_info['Last Changed Rev'];
$trunk_url = $svn_info['Repository Root'] . '/htmlpurifier/trunk';
echo "Last revision was $last_rev, merging from $last_rev to head.\n";
$merge_cmd = "svn merge -r $last_rev:HEAD $trunk_url .";
$out = explode("\n", shell_exec($merge_cmd));
echo "Conflicted files:\n";
foreach ($out as $line) {
if (empty($line)) continue;
if ($line{0} === 'C' || $line{1} === 'C') echo $line . "\n";
}
$version = trim(file_get_contents('VERSION'));
echo "Resolve conflicts and then commit as 'Release $version, merged in $last_rev to HEAD.'";
?>

21
release3-tag.php Normal file
View File

@ -0,0 +1,21 @@
<?php
// Tags releases
require 'svn.php';
$svn_info = svn_info('.');
$version = trim(file_get_contents('VERSION'));
$trunk_url = $svn_info['Repository Root'] . '/htmlpurifier/trunk';
$strict_url = $svn_info['Repository Root'] . '/htmlpurifier/branches/strict';
$trunk_tag_url = $svn_info['Repository Root'] . '/htmlpurifier/tags/' . $version;
$strict_tag_url = $svn_info['Repository Root'] . '/htmlpurifier/tags/' . $version . '-strict';
echo "Tagging trunk to tags/$version...";
passthru("svn copy --message \"Tag $version release.\" $trunk_url $trunk_tag_url");
echo "Tagging strict to tags/$version-strict...";
passthru("svn copy --message \"Tag $version-strict release.\" $strict_url $strict_tag_url");
?>

14
svn.php Normal file
View File

@ -0,0 +1,14 @@
<?php
function svn_info($dir) {
$raw = explode("\n", shell_exec("svn info $dir"));
$svn_info = array();
foreach ($raw as $r) {
if (empty($r)) continue;
list($k, $v) = explode(': ', $r, 2);
$svn_info[$k] = $v;
}
return $svn_info;
}
?>