|
Lines 68-74
svn::Revision svn::cache::ReposLog::latestCachedRev()
Link Here
|
| 68 |
TQString q("select revision from 'logentries' order by revision DESC limit 1"); |
68 |
TQString q("select revision from 'logentries' order by revision DESC limit 1"); |
| 69 |
TQSqlQuery _q(TQString(), m_Database); |
69 |
TQSqlQuery _q(TQString(), m_Database); |
| 70 |
if (!_q.exec(q)) { |
70 |
if (!_q.exec(q)) { |
| 71 |
tqDebug("%s", TQString(_q.lastError().text().TOUTF8().data()).ascii()); |
71 |
tqDebug("%s", _q.lastError().text().TOUTF8().data()); |
| 72 |
return svn::Revision::UNDEFINED; |
72 |
return svn::Revision::UNDEFINED; |
| 73 |
} |
73 |
} |
| 74 |
int _r; |
74 |
int _r; |
|
Lines 76-82
svn::Revision svn::cache::ReposLog::latestCachedRev()
Link Here
|
| 76 |
//tqDebug("Sel result: %s",_q.value(0).toString().TOUTF8().data()); |
76 |
//tqDebug("Sel result: %s",_q.value(0).toString().TOUTF8().data()); |
| 77 |
_r = _q.value(0).toInt(); |
77 |
_r = _q.value(0).toInt(); |
| 78 |
} else { |
78 |
} else { |
| 79 |
tqDebug("%s", TQString(_q.lastError().text().TOUTF8().data()).ascii()); |
79 |
tqDebug("%s", _q.lastError().text().TOUTF8().data()); |
| 80 |
return svn::Revision::UNDEFINED; |
80 |
return svn::Revision::UNDEFINED; |
| 81 |
} |
81 |
} |
| 82 |
return _r; |
82 |
return _r; |
|
Lines 197-203
bool svn::cache::ReposLog::simpleLog(LogEntriesMap&target,const svn::Revision&_s
Link Here
|
| 197 |
bcount.bindValue(0,TQ_LLONG(end.revnum())); |
197 |
bcount.bindValue(0,TQ_LLONG(end.revnum())); |
| 198 |
bcount.bindValue(1,TQ_LLONG(start.revnum())); |
198 |
bcount.bindValue(1,TQ_LLONG(start.revnum())); |
| 199 |
if (!bcount.exec()) { |
199 |
if (!bcount.exec()) { |
| 200 |
tqDebug("%s", TQString(bcount.lastError().text().TOUTF8().data()).ascii()); |
200 |
tqDebug("%s", bcount.lastError().text().TOUTF8().data()); |
| 201 |
throw svn::cache::DatabaseException(TQString("Could not retrieve count: ")+bcount.lastError().text()); |
201 |
throw svn::cache::DatabaseException(TQString("Could not retrieve count: ")+bcount.lastError().text()); |
| 202 |
return false; |
202 |
return false; |
| 203 |
} |
203 |
} |
|
Lines 211-217
bool svn::cache::ReposLog::simpleLog(LogEntriesMap&target,const svn::Revision&_s
Link Here
|
| 211 |
bcur.bindValue(1,TQ_LLONG(start.revnum())); |
211 |
bcur.bindValue(1,TQ_LLONG(start.revnum())); |
| 212 |
|
212 |
|
| 213 |
if (!bcur.exec()) { |
213 |
if (!bcur.exec()) { |
| 214 |
tqDebug("%s", TQString(bcur.lastError().text().TOUTF8().data()).ascii()); |
214 |
tqDebug("%s", bcur.lastError().text().TOUTF8().data()); |
| 215 |
throw svn::cache::DatabaseException(TQString("Could not retrieve values: ")+bcur.lastError().text()); |
215 |
throw svn::cache::DatabaseException(TQString("Could not retrieve values: ")+bcur.lastError().text()); |
| 216 |
return false; |
216 |
return false; |
| 217 |
} |
217 |
} |
|
Lines 220-226
bool svn::cache::ReposLog::simpleLog(LogEntriesMap&target,const svn::Revision&_s
Link Here
|
| 220 |
revision = bcur.value(0).toLongLong(); |
220 |
revision = bcur.value(0).toLongLong(); |
| 221 |
cur.bindValue(0,revision); |
221 |
cur.bindValue(0,revision); |
| 222 |
if (!cur.exec()) { |
222 |
if (!cur.exec()) { |
| 223 |
tqDebug("%s", TQString(cur.lastError().text().TOUTF8().data()).ascii()); |
223 |
tqDebug("%s", cur.lastError().text().TOUTF8().data()); |
| 224 |
throw svn::cache::DatabaseException(TQString("Could not retrieve values: ")+cur.lastError().text() |
224 |
throw svn::cache::DatabaseException(TQString("Could not retrieve values: ")+cur.lastError().text() |
| 225 |
,cur.lastError().number()); |
225 |
,cur.lastError().number()); |
| 226 |
return false; |
226 |
return false; |
|
Lines 264-270
svn::Revision svn::cache::ReposLog::date2numberRev(const svn::Revision&aRev,bool
Link Here
|
| 264 |
TQSqlQuery query("select revision,date from logentries order by revision desc limit 1",m_Database); |
264 |
TQSqlQuery query("select revision,date from logentries order by revision desc limit 1",m_Database); |
| 265 |
|
265 |
|
| 266 |
if (query.lastError().type()!=TQSqlError::None) { |
266 |
if (query.lastError().type()!=TQSqlError::None) { |
| 267 |
tqDebug("%s", TQString(query.lastError().text().TOUTF8().data()).ascii()); |
267 |
tqDebug("%s", query.lastError().text().TOUTF8().data()); |
| 268 |
} |
268 |
} |
| 269 |
bool must_remote=!noNetwork; |
269 |
bool must_remote=!noNetwork; |
| 270 |
if (query.next()) { |
270 |
if (query.next()) { |
|
Lines 283-289
svn::Revision svn::cache::ReposLog::date2numberRev(const svn::Revision&aRev,bool
Link Here
|
| 283 |
query.bindValue(0,TQ_LLONG(aRev.date())); |
283 |
query.bindValue(0,TQ_LLONG(aRev.date())); |
| 284 |
query.exec(); |
284 |
query.exec(); |
| 285 |
if (query.lastError().type()!=TQSqlError::None) { |
285 |
if (query.lastError().type()!=TQSqlError::None) { |
| 286 |
tqDebug("%s", TQString(query.lastError().text().TOUTF8().data()).ascii()); |
286 |
tqDebug("%s", query.lastError().text().TOUTF8().data()); |
| 287 |
} |
287 |
} |
| 288 |
if (query.next()) { |
288 |
if (query.next()) { |
| 289 |
return query.value(0).toInt(); |
289 |
return query.value(0).toInt(); |
|
Lines 320-326
bool svn::cache::ReposLog::_insertLogEntry(const svn::LogEntry&aEntry)
Link Here
|
| 320 |
if (!_q.exec()) { |
320 |
if (!_q.exec()) { |
| 321 |
m_Database->rollback(); |
321 |
m_Database->rollback(); |
| 322 |
tqDebug("Could not insert values: %s",_q.lastError().text().TOUTF8().data()); |
322 |
tqDebug("Could not insert values: %s",_q.lastError().text().TOUTF8().data()); |
| 323 |
tqDebug("%s", TQString(_q.lastQuery().TOUTF8().data()).ascii()); |
323 |
tqDebug("%s", _q.lastQuery().TOUTF8().data()); |
| 324 |
throw svn::cache::DatabaseException(TQString("Could not insert values: ")+_q.lastError().text(),_q.lastError().number()); |
324 |
throw svn::cache::DatabaseException(TQString("Could not insert values: ")+_q.lastError().text(),_q.lastError().number()); |
| 325 |
} |
325 |
} |
| 326 |
_q.prepare(qPathes); |
326 |
_q.prepare(qPathes); |
|
Lines 334-340
bool svn::cache::ReposLog::_insertLogEntry(const svn::LogEntry&aEntry)
Link Here
|
| 334 |
if (!_q.exec()) { |
334 |
if (!_q.exec()) { |
| 335 |
m_Database->rollback(); |
335 |
m_Database->rollback(); |
| 336 |
tqDebug("Could not insert values: %s",_q.lastError().text().TOUTF8().data()); |
336 |
tqDebug("Could not insert values: %s",_q.lastError().text().TOUTF8().data()); |
| 337 |
tqDebug("%s", TQString(_q.lastQuery().TOUTF8().data()).ascii()); |
337 |
tqDebug("%s", _q.lastQuery().TOUTF8().data()); |
| 338 |
throw svn::cache::DatabaseException(TQString("Could not insert values: ")+_q.lastError().text(),_q.lastError().number()); |
338 |
throw svn::cache::DatabaseException(TQString("Could not insert values: ")+_q.lastError().text(),_q.lastError().number()); |
| 339 |
} |
339 |
} |
| 340 |
} |
340 |
} |
|
Lines 375-381
bool svn::cache::ReposLog::log(const svn::Path&what,const svn::Revision&_start,
Link Here
|
| 375 |
_q.prepare(query_string); |
375 |
_q.prepare(query_string); |
| 376 |
if (!_q.exec()) { |
376 |
if (!_q.exec()) { |
| 377 |
tqDebug("Could not select values: %s",_q.lastError().text().TOUTF8().data()); |
377 |
tqDebug("Could not select values: %s",_q.lastError().text().TOUTF8().data()); |
| 378 |
tqDebug("%s", TQString(_q.lastQuery().TOUTF8().data()).ascii()); |
378 |
tqDebug("%s", _q.lastQuery().TOUTF8().data()); |
| 379 |
throw svn::cache::DatabaseException(TQString("Could not select values: ")+_q.lastError().text(),_q.lastError().number()); |
379 |
throw svn::cache::DatabaseException(TQString("Could not select values: ")+_q.lastError().text(),_q.lastError().number()); |
| 380 |
} |
380 |
} |
| 381 |
while(_q.next()) { |
381 |
while(_q.next()) { |