diff options
author | Ulrich Spörlein <uqs@spoerlein.net> | 2012-11-20 17:29:00 +0100 |
---|---|---|
committer | Ulrich Spörlein <uqs@spoerlein.net> | 2012-11-27 15:30:36 +0100 |
commit | 4d4456f422bae0dfdd514ed42801889bd66b6fa0 (patch) | |
tree | 7bab15bf5fe204fe8afc9e37b130959ffaeaa97f | |
parent | bd5e2c4c66543b59950380f6c6549debe8d4d0b3 (diff) | |
download | svn2git-4d4456f422bae0dfdd514ed42801889bd66b6fa0.tar svn2git-4d4456f422bae0dfdd514ed42801889bd66b6fa0.tar.gz svn2git-4d4456f422bae0dfdd514ed42801889bd66b6fa0.tar.bz2 svn2git-4d4456f422bae0dfdd514ed42801889bd66b6fa0.tar.xz svn2git-4d4456f422bae0dfdd514ed42801889bd66b6fa0.zip |
Use fastimport.write for the actual commit objects too, so we get
logging when --debug-rules is turned on.
-rw-r--r-- | src/repository.cpp | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/src/repository.cpp b/src/repository.cpp index 4d23cab..779dd28 100644 --- a/src/repository.cpp +++ b/src/repository.cpp @@ -682,15 +682,16 @@ void Repository::Transaction::commitNote(const QByteArray ¬eText, bool append message = "Appending Git note for current " + commitRef + "\n"; } - QTextStream s(&repository->fastImport); - s << "commit refs/notes/commits" << endl - << "mark :" << QByteArray::number(maxMark + 1) << endl - << "committer " << QString::fromUtf8(author) << ' ' << datetime << " +0000" << endl - << "data " << message.length() << endl - << message << endl - << "N inline " << commitRef << endl - << "data " << text.length() << endl - << text << endl; + QByteArray s(""); + s.append("commit refs/notes/commits\n"); + s.append("mark :" + QByteArray::number(maxMark + 1) + "\n"); + s.append("committer " + QString::fromUtf8(author) + " " + QString::number(datetime) + " +0000" + "\n"); + s.append("data " + QString::number(message.length()) + "\n"); + s.append(message + "\n"); + s.append("N inline " + commitRef + "\n"); + s.append("data " + QString::number(text.length()) + "\n"); + s.append(text + "\n"); + repository->fastImport.write(s); if (commit.isNull()) { repository->setBranchNote(QString::fromUtf8(branch), text); @@ -728,21 +729,17 @@ void Repository::Transaction::commit() br.commits.append(revnum); br.marks.append(mark); - { - QByteArray branchRef = branch; - if (!branchRef.startsWith("refs/")) - branchRef.prepend("refs/heads/"); - QTextStream s(&repository->fastImport); - s.setCodec("UTF-8"); - s << "commit " << branchRef << endl; - s << "mark :" << QByteArray::number(mark) << endl; - s << "committer " << QString::fromUtf8(author) << ' ' << datetime << " +0000" << endl; - - s << "data " << message.length() << endl; - } + QByteArray branchRef = branch; + if (!branchRef.startsWith("refs/")) + branchRef.prepend("refs/heads/"); - repository->fastImport.write(message); - repository->fastImport.putChar('\n'); + QByteArray s(""); + s.append("commit " + branchRef + "\n"); + s.append("mark :" + QByteArray::number(mark) + "\n"); + s.append("committer " + QString::fromUtf8(author) + " " + QString::number(datetime) + " +0000" + "\n"); + s.append("data " + QString::number(message.length()) + "\n"); + s.append(message + "\n"); + repository->fastImport.write(s); // note some of the inferred merges QByteArray desc = ""; |