* fix bug.

This commit is contained in:
wangyidong
2020-03-04 18:34:37 +08:00
parent 718373cc06
commit 94b3675289
3 changed files with 13 additions and 9 deletions
+3 -3
View File
@@ -99,7 +99,7 @@ class gitModel extends model
$tagGroup = array();
foreach($tagPlans as $integration) $tagGroup[$integration->repo][$integration->id] = $integration;
foreach($this->repos as $repo)
foreach($this->repos as $repoID => $repo)
{
$this->printLog("begin repo $repo->id");
if(!$this->setRepo($repo)) return false;
@@ -112,7 +112,7 @@ class gitModel extends model
$this->printLog("get this repo logs.");
$lastInDB = $this->getLatestComment($repoID);
$lastInDB = $this->repo->getLatestComment($repoID);
/* Ignore unsynced branch. */
if(empty($lastInDB)) continue;
@@ -157,7 +157,7 @@ class gitModel extends model
}
}
$version = $this->repo->saveOneCommit($repoID, $log, $version);
$commits += count($logs)
$commits += count($logs);
}
}
$this->repo->updateCommitCount($repoID, $commits);
+9 -5
View File
@@ -557,13 +557,17 @@ class repoModel extends model
if($existsRevision)
{
if($branch) $this->dao->replace(TABLE_REPOBRANCH)->set('repo')->eq($repoID)->set('revision')->eq($existsRevision->id)->set('branch')->eq($branch)->exec();
continue;
return true;
}
$commit->repo = $repoID;
$commit->commit = $version;
$commit->comment = htmlspecialchars($commit->comment);
$this->dao->insert(TABLE_REPOHISTORY)->data($commit)->exec();
$history = new stdclass();
$history->repo = $repoID;
$history->revision = $commit->revision;
$history->committer = $commit->committer;
$history->time = $commit->time;
$history->commit = $version;
$history->comment = htmlspecialchars($commit->comment);
$this->dao->insert(TABLE_REPOHISTORY)->data($history)->exec();
if(!dao::isError())
{
$commitID = $this->dao->lastInsertID();
+1 -1
View File
@@ -106,7 +106,7 @@ class svnModel extends model
if(!$this->setRepo($repo)) return false;
$this->printLog("get this repo logs.");
$lastInDB = $this->getLatestComment($repoID);
$lastInDB = $this->repo->getLatestComment($repoID);
/* Ignore unsynced repo. */
if(empty($lastInDB)) continue;