|
|
|
@ -40,12 +40,12 @@ svn::Revision svn::cache::ReposLog::latestHeadRev()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/// no catch - exception has go trough...
|
|
|
|
|
qDebug("Getting headrev");
|
|
|
|
|
tqDebug("Getting headrev");
|
|
|
|
|
svn::InfoEntries e = m_Client->info(m_ReposRoot,svn::DepthEmpty,svn::Revision::HEAD,svn::Revision::HEAD);
|
|
|
|
|
if (e.count()<1||e[0].reposRoot().isEmpty()) {
|
|
|
|
|
return svn::Revision::UNDEFINED;
|
|
|
|
|
}
|
|
|
|
|
qDebug("Getting headrev done");
|
|
|
|
|
tqDebug("Getting headrev done");
|
|
|
|
|
return e[0].revision();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -68,15 +68,15 @@ svn::Revision svn::cache::ReposLog::latestCachedRev()
|
|
|
|
|
TQString q("select revision from 'logentries' order by revision DESC limit 1");
|
|
|
|
|
TQSqlQuery _q(TQString(), m_Database);
|
|
|
|
|
if (!_q.exec(q)) {
|
|
|
|
|
qDebug(_q.lastError().text().TOUTF8().data());
|
|
|
|
|
tqDebug(_q.lastError().text().TOUTF8().data());
|
|
|
|
|
return svn::Revision::UNDEFINED;
|
|
|
|
|
}
|
|
|
|
|
int _r;
|
|
|
|
|
if (_q.isActive() && _q.next()) {
|
|
|
|
|
//qDebug("Sel result: %s",_q.value(0).toString().TOUTF8().data());
|
|
|
|
|
//tqDebug("Sel result: %s",_q.value(0).toString().TOUTF8().data());
|
|
|
|
|
_r = _q.value(0).toInt();
|
|
|
|
|
} else {
|
|
|
|
|
qDebug(_q.lastError().text().TOUTF8().data());
|
|
|
|
|
tqDebug(_q.lastError().text().TOUTF8().data());
|
|
|
|
|
return svn::Revision::UNDEFINED;
|
|
|
|
|
}
|
|
|
|
|
return _r;
|
|
|
|
@ -94,8 +94,8 @@ bool svn::cache::ReposLog::checkFill(svn::Revision&start,svn::Revision&end,bool
|
|
|
|
|
long long icount=0;
|
|
|
|
|
|
|
|
|
|
svn::Revision _latest=latestCachedRev();
|
|
|
|
|
// qDebug("Latest cached rev: %i",_latest.revnum());
|
|
|
|
|
// qDebug("End revision is: %s",end.toString().TOUTF8().data());
|
|
|
|
|
// tqDebug("Latest cached rev: %i",_latest.revnum());
|
|
|
|
|
// tqDebug("End revision is: %s",end.toString().TOUTF8().data());
|
|
|
|
|
|
|
|
|
|
if (checkHead && _latest.revnum()>=latestHeadRev().revnum()) {
|
|
|
|
|
return true;
|
|
|
|
@ -113,21 +113,21 @@ bool svn::cache::ReposLog::checkFill(svn::Revision&start,svn::Revision&end,bool
|
|
|
|
|
svn::Revision _rstart=_latest.revnum()+1;
|
|
|
|
|
svn::Revision _rend = end;
|
|
|
|
|
if (_rend==svn::Revision::UNDEFINED) {
|
|
|
|
|
// qDebug("Setting end to Head");
|
|
|
|
|
// tqDebug("Setting end to Head");
|
|
|
|
|
_rend=svn::Revision::HEAD;
|
|
|
|
|
}
|
|
|
|
|
// no catch - exception should go outside.
|
|
|
|
|
if (_rstart==0){
|
|
|
|
|
_rstart = 1;
|
|
|
|
|
}
|
|
|
|
|
// qDebug("Getting log %s -> %s",_rstart.toString().TOUTF8().data(),_rend.toString().TOUTF8().data());
|
|
|
|
|
// tqDebug("Getting log %s -> %s",_rstart.toString().TOUTF8().data(),_rend.toString().TOUTF8().data());
|
|
|
|
|
if (_rend==svn::Revision::HEAD) {
|
|
|
|
|
_rend=latestHeadRev();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (_rend==svn::Revision::HEAD||_rend.revnum()>_latest.revnum()) {
|
|
|
|
|
LogEntriesMap _internal;
|
|
|
|
|
// qDebug("Retrieving from network.");
|
|
|
|
|
// tqDebug("Retrieving from network.");
|
|
|
|
|
if (!m_Client->log(m_ReposRoot,_rstart,_rend,_internal,svn::Revision::UNDEFINED,true,false)) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
@ -197,7 +197,7 @@ bool svn::cache::ReposLog::simpleLog(LogEntriesMap&target,const svn::Revision&_s
|
|
|
|
|
bcount.bindValue(0,TQ_LLONG(end.revnum()));
|
|
|
|
|
bcount.bindValue(1,TQ_LLONG(start.revnum()));
|
|
|
|
|
if (!bcount.exec()) {
|
|
|
|
|
qDebug(bcount.lastError().text().TOUTF8().data());
|
|
|
|
|
tqDebug(bcount.lastError().text().TOUTF8().data());
|
|
|
|
|
throw svn::cache::DatabaseException(TQString("Could not retrieve count: ")+bcount.lastError().text());
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
@ -211,7 +211,7 @@ bool svn::cache::ReposLog::simpleLog(LogEntriesMap&target,const svn::Revision&_s
|
|
|
|
|
bcur.bindValue(1,TQ_LLONG(start.revnum()));
|
|
|
|
|
|
|
|
|
|
if (!bcur.exec()) {
|
|
|
|
|
qDebug(bcur.lastError().text().TOUTF8().data());
|
|
|
|
|
tqDebug(bcur.lastError().text().TOUTF8().data());
|
|
|
|
|
throw svn::cache::DatabaseException(TQString("Could not retrieve values: ")+bcur.lastError().text());
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
@ -220,7 +220,7 @@ bool svn::cache::ReposLog::simpleLog(LogEntriesMap&target,const svn::Revision&_s
|
|
|
|
|
revision = bcur.value(0).toLongLong();
|
|
|
|
|
cur.bindValue(0,revision);
|
|
|
|
|
if (!cur.exec()) {
|
|
|
|
|
qDebug(cur.lastError().text().TOUTF8().data());
|
|
|
|
|
tqDebug(cur.lastError().text().TOUTF8().data());
|
|
|
|
|
throw svn::cache::DatabaseException(TQString("Could not retrieve values: ")+cur.lastError().text()
|
|
|
|
|
,cur.lastError().number());
|
|
|
|
|
return false;
|
|
|
|
@ -264,7 +264,7 @@ svn::Revision svn::cache::ReposLog::date2numberRev(const svn::Revision&aRev,bool
|
|
|
|
|
TQSqlQuery query("select revision,date from logentries order by revision desc limit 1",m_Database);
|
|
|
|
|
|
|
|
|
|
if (query.lastError().type()!=TQSqlError::None) {
|
|
|
|
|
qDebug(query.lastError().text().TOUTF8().data());
|
|
|
|
|
tqDebug(query.lastError().text().TOUTF8().data());
|
|
|
|
|
}
|
|
|
|
|
bool must_remote=!noNetwork;
|
|
|
|
|
if (query.next()) {
|
|
|
|
@ -283,7 +283,7 @@ svn::Revision svn::cache::ReposLog::date2numberRev(const svn::Revision&aRev,bool
|
|
|
|
|
query.bindValue(0,TQ_LLONG(aRev.date()));
|
|
|
|
|
query.exec();
|
|
|
|
|
if (query.lastError().type()!=TQSqlError::None) {
|
|
|
|
|
qDebug(query.lastError().text().TOUTF8().data());
|
|
|
|
|
tqDebug(query.lastError().text().TOUTF8().data());
|
|
|
|
|
}
|
|
|
|
|
if (query.next()) {
|
|
|
|
|
return query.value(0).toInt();
|
|
|
|
@ -319,8 +319,8 @@ bool svn::cache::ReposLog::_insertLogEntry(const svn::LogEntry&aEntry)
|
|
|
|
|
_q.bindValue(3,aEntry.message);
|
|
|
|
|
if (!_q.exec()) {
|
|
|
|
|
m_Database->rollback();
|
|
|
|
|
qDebug("Could not insert values: %s",_q.lastError().text().TOUTF8().data());
|
|
|
|
|
qDebug(_q.lastQuery().TOUTF8().data());
|
|
|
|
|
tqDebug("Could not insert values: %s",_q.lastError().text().TOUTF8().data());
|
|
|
|
|
tqDebug(_q.lastQuery().TOUTF8().data());
|
|
|
|
|
throw svn::cache::DatabaseException(TQString("Could not insert values: ")+_q.lastError().text(),_q.lastError().number());
|
|
|
|
|
}
|
|
|
|
|
_q.prepare(qPathes);
|
|
|
|
@ -333,8 +333,8 @@ bool svn::cache::ReposLog::_insertLogEntry(const svn::LogEntry&aEntry)
|
|
|
|
|
_q.bindValue(4,TQ_LLONG((*cpit).copyFromRevision));
|
|
|
|
|
if (!_q.exec()) {
|
|
|
|
|
m_Database->rollback();
|
|
|
|
|
qDebug("Could not insert values: %s",_q.lastError().text().TOUTF8().data());
|
|
|
|
|
qDebug(_q.lastQuery().TOUTF8().data());
|
|
|
|
|
tqDebug("Could not insert values: %s",_q.lastError().text().TOUTF8().data());
|
|
|
|
|
tqDebug(_q.lastQuery().TOUTF8().data());
|
|
|
|
|
throw svn::cache::DatabaseException(TQString("Could not insert values: ")+_q.lastError().text(),_q.lastError().number());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -374,8 +374,8 @@ bool svn::cache::ReposLog::log(const svn::Path&what,const svn::Revision&_start,
|
|
|
|
|
TQSqlQuery _q2(TQString(),m_Database);
|
|
|
|
|
_q.prepare(query_string);
|
|
|
|
|
if (!_q.exec()) {
|
|
|
|
|
qDebug("Could not select values: %s",_q.lastError().text().TOUTF8().data());
|
|
|
|
|
qDebug(_q.lastQuery().TOUTF8().data());
|
|
|
|
|
tqDebug("Could not select values: %s",_q.lastError().text().TOUTF8().data());
|
|
|
|
|
tqDebug(_q.lastQuery().TOUTF8().data());
|
|
|
|
|
throw svn::cache::DatabaseException(TQString("Could not select values: ")+_q.lastError().text(),_q.lastError().number());
|
|
|
|
|
}
|
|
|
|
|
while(_q.next()) {
|
|
|
|
@ -387,7 +387,7 @@ bool svn::cache::ReposLog::log(const svn::Path&what,const svn::Revision&_start,
|
|
|
|
|
query_string=s_e.arg(revision);
|
|
|
|
|
_q2.prepare(query_string);
|
|
|
|
|
if (!_q2.exec()) {
|
|
|
|
|
qDebug("Could not select values: %s",_q2.lastError().text().TOUTF8().data());
|
|
|
|
|
tqDebug("Could not select values: %s",_q2.lastError().text().TOUTF8().data());
|
|
|
|
|
} else {
|
|
|
|
|
while (_q2.next()) {
|
|
|
|
|
target[revision].changedPaths.push_back (
|
|
|
|
@ -418,11 +418,11 @@ bool svn::cache::ReposLog::itemExists(const svn::Revision&peg,const svn::Path&pa
|
|
|
|
|
TQSqlQuery _q(TQString(),m_Database);
|
|
|
|
|
TQString query_string=TQString(_s1).arg(path.native()).arg(peg.revnum());
|
|
|
|
|
if (!_q.exec(query_string)) {
|
|
|
|
|
qDebug("Could not select values: %s",_q.lastError().text().TOUTF8().data());
|
|
|
|
|
qDebug(_q.lastQuery().TOUTF8().data());
|
|
|
|
|
tqDebug("Could not select values: %s",_q.lastError().text().TOUTF8().data());
|
|
|
|
|
tqDebug(_q.lastQuery().TOUTF8().data());
|
|
|
|
|
throw svn::cache::DatabaseException(TQString("Could not select values: ")+_q.lastError().text(),_q.lastError().number());
|
|
|
|
|
}
|
|
|
|
|
qDebug(_q.lastQuery().TOUTF8().data());
|
|
|
|
|
tqDebug(_q.lastQuery().TOUTF8().data());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
svn::Path _p = path;
|
|
|
|
|