<?php // Merges in changes from trunk to strict branch // WORKING COPY MUST BE POINTED TO STRICT BRANCH if (php_sapi_name() != 'cli') { echo 'Release script cannot be called from web-browser.'; exit; } 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.'";
/** * Authenticate to the repository * * @access public * @author Cédric Alfonsi, <*****@*****.**> * @param Repository vcs * @param string login * @param string password * @return boolean */ public function authenticate(core_kernel_versioning_Repository $vcs, $login, $password) { $returnValue = (bool) false; //if the system has already do its authentication to the repository, return the negociation result if (isset(self::$authenticatedRepositories[$vcs->getUri()])) { $returnValue = self::$authenticatedRepositories[$vcs->getUri()]; } else { svn_auth_set_parameter(PHP_SVN_AUTH_PARAM_IGNORE_SSL_VERIFY_ERRORS, true); // <--- Important for certificate issues! svn_auth_set_parameter(SVN_AUTH_PARAM_NON_INTERACTIVE, true); svn_auth_set_parameter(SVN_AUTH_PARAM_NO_AUTH_CACHE, true); svn_auth_set_parameter(SVN_AUTH_PARAM_DONT_STORE_PASSWORDS, true); svn_auth_set_parameter(SVN_AUTH_PARAM_DEFAULT_USERNAME, $login); svn_auth_set_parameter(SVN_AUTH_PARAM_DEFAULT_PASSWORD, $password); if (@svn_info((string) $vcs->getOnePropertyValue(new core_kernel_classes_property(PROPERTY_GENERIS_VERSIONEDREPOSITORY_URL)), false) !== false) { $returnValue = true; } } self::$authenticatedRepositories[$vcs->getUri()] = $returnValue; return (bool) $returnValue; }