- for line in f:
- m = re_rev.match(line)
- if m:
- rev = m.group(1)
- continue
-
- if (lastrev >= int(rev)):
- continue
-
- m = re_keywords.match(line)
- if m:
- path = urllib.unquote(m.group(1))
- keywords = set(urllib.unquote(m.group(2)).split(' '))
- if not FILES.has_section(path):
- FILES.add_section(path)
- FILES.set(path, rev, keywords)
-
- lastrev = max(int(rev), lastrev)
+ for d in os.listdir(base):
+ subent = os.path.join(base, d)
+ if (d == 'unhandled.log' and os.path.isfile(subent)):
+ with open(subent, 'r') as f:
+ # Compile the regular expressions we'll be using here.
+ re_rev = re.compile("^r(\d+)$")
+ re_keywords = re.compile("^\s+[-+]file_prop: (\S+) svn:keywords ?(\S*)$")
+
+ for line in f:
+ m = re_rev.match(line)
+ if m:
+ rev = m.group(1)
+ continue
+
+ if (lastrev >= int(rev)):
+ continue
+
+ m = re_keywords.match(line)
+ if m:
+ path = urllib.unquote(m.group(1))
+ keywords = set(urllib.unquote(m.group(2)).split(' '))
+ if not FILES.has_section(path):
+ FILES.add_section(path)
+ FILES.set(path, rev, keywords)
+ elif (os.path.isdir(subent)):
+ _do_parse_unhandled(subent, lastrev=lastrev)
+
+ if rev:
+ lastrev = max(int(rev), lastrev)