Add a --no-metadata option to suppress the svn info in commit messages.
authorAnders Kaseorg <andersk@MIT.EDU>
Sat, 3 Jan 2009 23:21:56 +0000 (3 18:21 -0500)
committerThiago Macieira <thiago@kde.org>
Thu, 8 Jan 2009 15:58:07 +0000 (8 16:58 +0100)
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Signed-off-by: Thiago Macieira <thiago@kde.org>
src/options.cpp
src/repository.cpp

index 0de8625..892b6e1 100644 (file)
@@ -42,7 +42,7 @@ void Options::showHelp()
 void Options::parseArguments(const QStringList &argumentList)
 {
     QSet<QString> validOptions;
-    validOptions << "help";
+    validOptions << "help" << "metadata";
 
     QSet<QString> validOptionsWithComplement;
     validOptionsWithComplement << "resume-from" << "max-rev" << "identity-map";
index 5faf2af..9c2a9d5 100644 (file)
@@ -16,6 +16,7 @@
  */
 
 #include "repository.h"
+#include "options.h"
 #include <QTextStream>
 #include <QDebug>
 #include <QLinkedList>
@@ -246,7 +247,8 @@ void Repository::Transaction::commit()
     QByteArray message = log;
     if (!message.endsWith('\n'))
         message += '\n';
-    message += "\nsvn path=" + svnprefix + "; revision=" + QByteArray::number(revnum) + "\n";
+    if (Options::globalOptions->switches.value("metadata", true))
+        message += "\nsvn path=" + svnprefix + "; revision=" + QByteArray::number(revnum) + "\n";
 
     {
         QByteArray branchRef = branch;