aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago@cassini.local.lan>2007-12-24 21:30:30 -0200
committerThiago Macieira <thiago@cassini.local.lan>2007-12-24 21:30:30 -0200
commit2ddd1758e673d8d5eba2a298eb1c5ad2760b481b (patch)
treecaa58efc821434ef8b03a5b056dca46049262281
parent6b450d1d7ec57ed13d5fd22c639f08d0737f4af8 (diff)
downloadsvn2git-2ddd1758e673d8d5eba2a298eb1c5ad2760b481b.tar
svn2git-2ddd1758e673d8d5eba2a298eb1c5ad2760b481b.tar.gz
svn2git-2ddd1758e673d8d5eba2a298eb1c5ad2760b481b.tar.bz2
svn2git-2ddd1758e673d8d5eba2a298eb1c5ad2760b481b.tar.xz
svn2git-2ddd1758e673d8d5eba2a298eb1c5ad2760b481b.zip
Beautify the rule debug output
-rw-r--r--src/ruleparser.cpp9
-rw-r--r--src/ruleparser.h5
-rw-r--r--src/svn.cpp8
3 files changed, 18 insertions, 4 deletions
diff --git a/src/ruleparser.cpp b/src/ruleparser.cpp
index b17bb96..c90d103 100644
--- a/src/ruleparser.cpp
+++ b/src/ruleparser.cpp
@@ -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
diff --git a/src/ruleparser.h b/src/ruleparser.h
index 7f458e7..9525f14 100644
--- a/src/ruleparser.h
+++ b/src/ruleparser.h
@@ -71,4 +71,9 @@ private:
QList<Match> m_matchRules;
};
+#ifndef QT_NO_DEBUG_STREAM
+class QDebug;
+QDebug operator<<(QDebug, const Rules::Match &);
+#endif
+
#endif
diff --git a/src/svn.cpp b/src/svn.cpp
index 84ed9a4..615f9e1 100644
--- a/src/svn.cpp
+++ b/src/svn.cpp
@@ -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;
}