
We are currently working on Drupal modules which are versioned in Subversion. We often make new releases and for every release, we also create tags in SVN. In Java, there's a tool called Maven which has a "release plugin". This plugin helps you releasing.
Drupal doesn't have this tool, so we are creating a "release management tool" which does the same for us. We simply specify the module we want to release. The stable version is introduced and the new version is proposed. Creating tags happens now automatically using the PHP SVN API. More details can be found here: http://php.net/manual/en/book.svn.php.
However, it took me some time to understand the API, as it's not very well documented. I even wasn't able to find a perfect example on the internet.
$svn_repos = svn_repos_open("##PATH_TO_REPO##"); $svn_fs = svn_repos_fs($svn_repos); // init 'from' resource $svn_fs_root = svn_fs_revision_root($svn_fs, svn_fs_youngest_rev($svn_fs)); // init 'to' resource $svn_tx = svn_fs_begin_txn2($svn_fs, svn_fs_youngest_rev($svn_fs)); $svn_tx_root = svn_fs_txn_root($svn_tx); // execute copy command svn_fs_copy( $svn_fs_root, "##FROM_PATH##", $svn_tx_root, "##TO_PATH##"); // commit svn_repos_fs_commit_txn($svn_tx);
Add new comment