@@ -193,11 +193,14 @@ int SvnPrivate::openRepository(const QString &pathToRepository)
193
193
194
194
enum RuleType { AnyRule = 0 , NoIgnoreRule = 0x01 , NoRecurseRule = 0x02 };
195
195
196
- static MatchRuleList::ConstIterator
197
- findMatchRule (const MatchRuleList &matchRules, int revnum, const QString ¤t,
198
- int ruleMask = AnyRule)
199
- {
200
- MatchRuleList::ConstIterator it = matchRules.constBegin (),
196
+ static MatchRuleList::ConstIterator findMatchRule (
197
+ const MatchRuleList &matchRules,
198
+ int revnum,
199
+ const QString ¤t,
200
+ const MatchRuleList::ConstIterator from,
201
+ int ruleMask = AnyRule
202
+ ) {
203
+ MatchRuleList::ConstIterator it = from,
201
204
end = matchRules.constEnd ();
202
205
for ( ; it != end; ++it) {
203
206
if (it->minRevision > revnum)
@@ -630,13 +633,19 @@ int SvnRevision::exportEntry(const char *key, const svn_fs_path_change2_t *chang
630
633
// Replace all returns with continue,
631
634
bool isHandled = false ;
632
635
foreach ( const MatchRuleList matchRules, allMatchRules ) {
633
- // find the first rule that matches this pathname
634
- MatchRuleList::ConstIterator match = findMatchRule (matchRules, revnum, current);
635
- if (match != matchRules.constEnd ()) {
636
+ MatchRuleList::ConstIterator match = matchRules.constBegin ();
637
+ while (true ) {
638
+ // find each rule that matches this pathname
639
+ match = findMatchRule (matchRules, revnum, current, match);
640
+ if (match == matchRules.constEnd ()) break ;
636
641
const Rules::Match &rule = *match;
637
642
if ( exportDispatch (key, change, path_from, rev_from, changes, current, rule, matchRules, revpool) == EXIT_FAILURE )
638
643
return EXIT_FAILURE;
639
644
isHandled = true ;
645
+ ++match;
646
+ }
647
+ if (isHandled) {
648
+ // while loop found rules
640
649
} else if (is_dir && path_from != NULL ) {
641
650
qDebug () << current << " is a copy-with-history, auto-recursing" ;
642
651
if ( recurse (key, change, path_from, matchRules, rev_from, changes, revpool) == EXIT_FAILURE )
@@ -738,7 +747,7 @@ int SvnRevision::exportInternal(const char *key, const svn_fs_path_change2_t *ch
738
747
previous += ' /' ;
739
748
}
740
749
MatchRuleList::ConstIterator prevmatch =
741
- findMatchRule (matchRules, rev_from, previous, NoIgnoreRule);
750
+ findMatchRule (matchRules, rev_from, previous, matchRules. constBegin (), NoIgnoreRule);
742
751
if (prevmatch != matchRules.constEnd ()) {
743
752
splitPathName (*prevmatch, previous, &prevsvnprefix, &prevrepository,
744
753
&preveffectiverepository, &prevbranch, &prevpath);
@@ -995,7 +1004,7 @@ int SvnRevision::recursiveDumpDir(Repository::Transaction *txn, svn_fs_t *fs, sv
995
1004
entryFinalName += ' /' ;
996
1005
QString entryNameQString = entryName + ' /' ;
997
1006
998
- MatchRuleList::ConstIterator match = findMatchRule (matchRules, revnum, entryNameQString);
1007
+ MatchRuleList::ConstIterator match = findMatchRule (matchRules, revnum, entryNameQString, matchRules. constBegin () );
999
1008
if (match == matchRules.constEnd ()) continue ; // no match of parent repo? (should not happen)
1000
1009
1001
1010
const Rules::Match &matchedRule = *match;
@@ -1076,12 +1085,18 @@ int SvnRevision::recurse(const char *path, const svn_fs_path_change2_t *change,
1076
1085
current += ' /' ;
1077
1086
1078
1087
// find the first rule that matches this pathname
1079
- MatchRuleList::ConstIterator match = findMatchRule (matchRules, revnum, current);
1080
- if (match != matchRules.constEnd ()) {
1088
+ bool matched = false ;
1089
+ MatchRuleList::ConstIterator match = matchRules.constBegin ();
1090
+ while (true ) {
1091
+ match = findMatchRule (matchRules, revnum, current, match);
1092
+ if (match == matchRules.constEnd ()) break ;
1093
+ matched = true ;
1081
1094
if (exportDispatch (entry, change, entryFrom.isNull () ? 0 : entryFrom.constData (),
1082
1095
rev_from, changes, current, *match, matchRules, dirpool) == EXIT_FAILURE)
1083
1096
return EXIT_FAILURE;
1084
- } else {
1097
+ ++match;
1098
+ }
1099
+ if (!matched) {
1085
1100
if (i.value () == svn_node_dir) {
1086
1101
qDebug () << current << " rev" << revnum
1087
1102
<< " did not match any rules; auto-recursing" ;
0 commit comments