]> andersk Git - svn-all-fast-export.git/commitdiff
Beautify the rule debug output
authorThiago Macieira <thiago@cassini.local.lan>
Mon, 24 Dec 2007 23:30:30 +0000 (21:30 -0200)
committerThiago Macieira <thiago@cassini.local.lan>
Mon, 24 Dec 2007 23:30:30 +0000 (21:30 -0200)
src/ruleparser.cpp
src/ruleparser.h
src/svn.cpp

index b17bb9631180de81e1a120fe6f6714b3735ee7cd..c90d10346173d8c36e5fe68cd19628ee9c6c62cc 100644 (file)
@@ -139,3 +139,12 @@ void Rules::load()
         }
     }
 }
+
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug s, const Rules::Match &rule)
+{
+    s.nospace() << rule.rx.pattern() << " (line " << rule.lineNumber << ")";
+    return s.maybeSpace();
+}
+
+#endif
index 7f458e7db3e5837d5251ebaffcf008109d8e703c..9525f1479cdbb7b61982552d3fa06c16e7c58666 100644 (file)
@@ -71,4 +71,9 @@ private:
     QList<Match> m_matchRules;
 };
 
+#ifndef QT_NO_DEBUG_STREAM
+class QDebug;
+QDebug operator<<(QDebug, const Rules::Match &);
+#endif
+
 #endif
index 84ed9a44c9d92056bd5177b63a666517f0158917..615f9e14d7292c42838cba891c69d4b0ca4d40c3 100644 (file)
@@ -477,7 +477,7 @@ int SvnRevision::exportEntry(const char *key, const svn_fs_path_change_t *change
         case Rules::Match::Ignore:
             // ignore rule
             qDebug() << "   " << qPrintable(current) << "rev" << revnum
-                     << "-> ignored (rule line" << rule.lineNumber << ")";
+                     << "-> ignored (rule" << rule << ")";
             return EXIT_SUCCESS;
 
         case Rules::Match::Recurse:
@@ -485,7 +485,7 @@ int SvnRevision::exportEntry(const char *key, const svn_fs_path_change_t *change
             if (is_dir)
                 return recurse(key, change, path_from, rev_from, revpool);
             if (change->change_kind != svn_fs_path_change_delete)
-                qWarning() << "   recurse rule " << rule.rx.pattern() << "line" << rule.lineNumber
+                qWarning() << "   recurse rule" << rule
                            << "applied to non-directory:" << qPrintable(current);
             return EXIT_SUCCESS;
 
@@ -556,7 +556,7 @@ int SvnRevision::exportInternal(const char *key, const svn_fs_path_change_t *cha
 
                 Repository *repo = repositories.value(repository, 0);
                 if (!repo) {
-                    qCritical() << "Rule" << rule.rx.pattern() << "line" << rule.lineNumber
+                    qCritical() << "Rule" << rule
                                 << "references unknown repository" << repository;
                     return EXIT_FAILURE;
                 }
@@ -570,7 +570,7 @@ int SvnRevision::exportInternal(const char *key, const svn_fs_path_change_t *cha
     if (!txn) {
         Repository *repo = repositories.value(repository, 0);
         if (!repo) {
-            qCritical() << "Rule" << rule.rx.pattern() << "line" << rule.lineNumber
+            qCritical() << "Rule" << rule
                         << "references unknown repository" << repository;
             return EXIT_FAILURE;
         }
This page took 0.065099 seconds and 5 git commands to generate.