* task#646.
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* encodings: 提交日志的编码,比如GBK,可以用逗号连接起来的多个。
|
||||
* client: svn客户端执行文件的路径,windows下面考虑安装Slik-Subversion,然后找到svn.exe的路径。linux下面比如/usr/bin/svn
|
||||
* repos可以是多个,需要设定某一个库的访问路径,已经用户名和密码。
|
||||
*
|
||||
* encodeings: the encoding of the comment,can be a list.
|
||||
* client: the svn client binary path. You can install Slik-Subversion unser windows, then find the path of svn.exe. under linux, try /usr/bin/svn
|
||||
* Can set multi repos, ervery one should set the path, username and password.
|
||||
*
|
||||
@@ -13,7 +15,8 @@
|
||||
* $config->svn->repos['pms']['password'] = 'pass';
|
||||
*
|
||||
*/
|
||||
$config->svn->client = '';
|
||||
$config->svn->encodings = 'utf-8, gbk';
|
||||
$config->svn->client = '';
|
||||
|
||||
$i = 1;
|
||||
$config->svn->repos[$i]['path'] = '';
|
||||
|
||||
@@ -320,6 +320,30 @@ class svnModel extends model
|
||||
return array('stories' => $stories, 'tasks' => $tasks, 'bugs' => $bugs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the comment to uft-8.
|
||||
*
|
||||
* @param string $comment
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function iconvComment($comment)
|
||||
{
|
||||
/* Get encodings. */
|
||||
$encodings = str_replace(' ', '', trim($comment));
|
||||
if($encodings == '') return $comment;
|
||||
$encodings = explode(',', $encodings);
|
||||
|
||||
/* Try convert. */
|
||||
foreach($encodings as $encoding)
|
||||
{
|
||||
$result = @iconv($encoding, 'utf-8', $comment);
|
||||
if($result) return $result;
|
||||
}
|
||||
|
||||
return $comment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Diff a url.
|
||||
*
|
||||
@@ -388,7 +412,7 @@ class svnModel extends model
|
||||
$action->actor = $log->author;
|
||||
$action->action = 'svncommited';
|
||||
$action->date = $log->date;
|
||||
$action->comment = $log->msg;
|
||||
$action->comment = $this->iconvComment($log->msg);
|
||||
$action->extra = $log->revision;
|
||||
|
||||
$changes = $this->createActionChanges($log, $repoRoot);
|
||||
|
||||
Reference in New Issue
Block a user