Rev 5452: Catch the two forms (bugs/authors) and (authors/bugs). We got the 1142 bugs. in file:///home/vila/src/bzr/experimental/fixed-in/

Vincent Ladeuil v.ladeuil+lp at free.fr
Tue Sep 28 02:00:57 BST 2010


At file:///home/vila/src/bzr/experimental/fixed-in/

------------------------------------------------------------
revno: 5452
revision-id: v.ladeuil+lp at free.fr-20100928010057-smfg2xjeeay3jhca
parent: v.ladeuil+lp at free.fr-20100928001820-675kun7uvifk8kjs
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: fixed-in
timestamp: Tue 2010-09-28 03:00:57 +0200
message:
  Catch the two forms (bugs/authors) and (authors/bugs). We got the 1142 bugs.
-------------- next part --------------
=== modified file 'tools/fixed-in.py'
--- a/tools/fixed-in.py	2010-09-28 00:18:20 +0000
+++ b/tools/fixed-in.py	2010-09-28 01:00:57 +0000
@@ -64,18 +64,25 @@
         # Not all entries will contain bugs and some entries are even garbage
         # that is not parsed (yet).
         # FIXME: Malone entries are different
-        # FIXME: instead of authors, #bugs we used to use #bugs, authors
-        # Allow multiple line matches without the need to tweak regexps
+        # Join all entry lines to simplify multiple line matching
         flat_entry = ' '.join(self.entry.splitlines())
         # Fixed bugs are always inside parens
         for par in self.paren_exp_re.findall(flat_entry):
             sharp = par.find('#')
-            if sharp:
-                bugs = self.bugs_re.findall(par[sharp:])
-                authors = par[:sharp].rstrip(', ')
-                for bug_number in bugs:
-                    if bug_number:
-                        print 'bug_number: [%r]' % (bug_number,)
+            if sharp is not None:
+                bugs = list(self.bugs_re.finditer(par))
+                if bugs:
+                    start = bugs[0].start()
+                    end = bugs[-1].end()
+                    if start == 0:
+                        # (bugs/authors)
+                        authors = par[end:]
+                    else:
+                        # (authors/bugs)
+                         authors = par[:start]
+                    for bug_match in bugs:
+                        bug_number = bug_match.group(0)
+                        print 'bug_number: [%r]' % (bug_number[1:],)
                         yield (bug_number, authors, self.release, self.entry)
         # We've consumed the entry
         self.entry = ''



More information about the bazaar-commits mailing list