svn: /web/doc-editor/trunk/php/ class.php
| From: | Yannick Torres | Date: | Wed, 11 Nov 2009 21:31:30 +0000 |
| Subject: | svn: /web/doc-editor/trunk/php/ class.php | ||
| Groups: | php.doc.web | ||
| Request: | Send a blank email to doc-web+get-1139@lists.php.net to get a copy of this message | ||
yannick Wed, 11 Nov 2009 21:31:30 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=290542
Log:
Remove cvsCommit's method from class.php. This method is present in RepositoryManager.php as
commitChanges's method
Changed paths:
U web/doc-editor/trunk/php/class.php
Modified: web/doc-editor/trunk/php/class.php
===================================================================
--- web/doc-editor/trunk/php/class.php 2009-11-11 21:27:48 UTC (rev 290541)
+++ web/doc-editor/trunk/php/class.php 2009-11-11 21:31:30 UTC (rev 290542)
@@ -1450,82 +1450,6 @@
}
/**
- * Commit some files to Cvs server.
- *
- * @param $anode An array of files to be commited.
- * @param $log The message log to use with this commit.
- * @return The message from Cvs server after this commit.
- */
- function cvsCommit($anode, $log) {
-
- $filesUpdate = array();
- $filesDelete = array();
- $filesNew = array();
-
- $cmdUpdate = '';
- $cmdDelete = '';
- $cmdNew = '';
-
- $nodes = $this->getModifiedFilesById($anode);
-
- // Loop over $nodes to find files to be delete, update, or new
- reset($nodes);
- for( $i=0; $i < count($nodes); $i++) {
-
- $fullPath =
$nodes[$i]['lang'].$nodes[$i]['path'].$nodes[$i]['name'];
-
- if( $nodes[$i]['type'] == 'delete' ) {
- $filesDelete[] = $fullPath;
- }
-
- if( $nodes[$i]['type'] == 'update' ) {
-
- $filesUpdate[] = $fullPath;
-
- // Pre-commit : We need move .new file into the real file
- @unlink( DOC_EDITOR_CVS_PATH.$fullPath);
- @copy( DOC_EDITOR_CVS_PATH.$fullPath.'.new',
DOC_EDITOR_CVS_PATH.$fullPath);
- @unlink( DOC_EDITOR_CVS_PATH.$fullPath.'.new');
-
- }
-
- if( $nodes[$i]['type'] == 'new' ) {
- $filesNew[] = $fullPath;
- }
- }
-
- // Linearization
- $filesDelete = implode($filesDelete, ' ');
- $filesUpdate = implode($filesUpdate, ' ');
- $filesNew = implode($filesNew, ' ');
-
- // Buil the command line
- if( trim($filesDelete) != '' ) {
- $cmdDelete = 'cvs -d
:pserver:'.$this->cvsLogin.':'.$this->cvsPasswd.'@cvs.php.net:/repository
-f remove -f '.$filesDelete.' && ';
- }
- if( trim($filesNew) != '' ) {
- $cmdNew = 'cvs -d
:pserver:'.$this->cvsLogin.':'.$this->cvsPasswd.'@cvs.php.net:/repository
-f add '.$filesNew.' && ';
- }
-
- // Escape single quote
- $log = str_replace("'", "\\'", $log);
-
- $cmd = $cmdDelete.
- $cmdNew.
- 'cvs -d
:pserver:'.$this->cvsLogin.':'.$this->cvsPasswd.'@cvs.php.net:/repository
-f commit -l -m \''.$log.'\' '.$filesUpdate.'
'.$filesDelete.' '.$filesNew;
-
- // First, login into Cvs
- $fullCmd = 'export CVS_PASSFILE='.realpath(DOC_EDITOR_DATA_PATH).'/.cvspass
&& cd '.DOC_EDITOR_CVS_PATH.' && cvs -d
:pserver:'.$this->cvsLogin.':'.$this->cvsPasswd.'@cvs.php.net:/repository
login && '.$cmd;
-
- $output = array();
- exec($fullCmd, $output);
-
- //$this->debug('commit cmd : '.$fullCmd);
-
- return $this->highlightCommitLog($output);
- }
-
- /**
* Highlights the given commit log
*
* @param $message The commit log