svn: /web/php-rmtools/trunk/include/ Storage.php Svn.php

From: Date: Sat, 09 Jan 2010 18:24:59 +0000
Subject: svn: /web/php-rmtools/trunk/include/ Storage.php Svn.php
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-6933@lists.php.net to get a copy of this message
pajoye Sat, 09 Jan 2010 18:24:59 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=293333 Log: - do the svn update at the same time (no extra cron/shell). Drop unused env Changed paths: U web/php-rmtools/trunk/include/Storage.php U web/php-rmtools/trunk/include/Svn.php Modified: web/php-rmtools/trunk/include/Storage.php =================================================================== --- web/php-rmtools/trunk/include/Storage.php 2010-01-09 17:33:15 UTC (rev 293332) +++ web/php-rmtools/trunk/include/Storage.php 2010-01-09 18:24:59 UTC (rev 293333) @@ -42,10 +42,11 @@ function updateRelease() { $svn = new Svn; + $svn->update($this->dev_branch); + $logxml = $svn->fetchLogFromBranch($this->dev_branch, $this->first_revision); - $logxml = $svn->fetchLogFromBranch($this->dev_branch, $this->first_revision); if (!$logxml) { - Throw new \Exception('SVN log failed ' ); + return FALSE; } foreach ($logxml->logentry as $v) { Modified: web/php-rmtools/trunk/include/Svn.php =================================================================== --- web/php-rmtools/trunk/include/Svn.php 2010-01-09 17:33:15 UTC (rev 293332) +++ web/php-rmtools/trunk/include/Svn.php 2010-01-09 18:24:59 UTC (rev 293333) @@ -16,12 +16,11 @@ 2 => array("pipe", "w") // stderr is a file to write to ); - $env = array('some_option' => 'aeiou'); $cmd = "svn log -r $first_revision:HEAD --xml"; $path = SVN_REPO_PATH . '/php-src/branches/' . $branch; - $process = proc_open($cmd, $descriptorspec, $pipes, $path, $env); + $process = proc_open($cmd, $descriptorspec, $pipes, $path); $log_xml = stream_get_contents($pipes[1]); fclose($pipes[1]); proc_close($process); @@ -33,6 +32,27 @@ return $sx; } + function update($branch) { + if (!static::isValidBranch($branch)) { + throw new \Exception('Invalid branch name ' . $branch); + return FALSE; + } + + $descriptorspec = array( + 1 => array("pipe", "w"), // stdout is a pipe that the child will write to + 2 => array("pipe", "w") // stderr is a file to write to + ); + + $cmd = "svn update"; + + $path = SVN_REPO_PATH . '/php-src/branches/' . $branch; + + $process = proc_open($cmd, $descriptorspec, $pipes, $path); + $out = stream_get_contents($pipes[1]); + fclose($pipes[1]); + proc_close($process); + } + /* TODO: do some sanity check if the branch is actually co'ed */ static function isValidBranch($branch) { $path = SVN_REPO_PATH . '/php-src/branches/' . $branch;

« previous php.webmaster (#6933) next »