Rev 5454: Explain extract_bugs_from_entry assumptions. in file:///home/vila/src/bzr/experimental/fixed-in/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Tue Sep 28 09:13:47 BST 2010
At file:///home/vila/src/bzr/experimental/fixed-in/
------------------------------------------------------------
revno: 5454
revision-id: v.ladeuil+lp at free.fr-20100928081347-qa8hjrdrmfd5g2s0
parent: v.ladeuil+lp at free.fr-20100928074454-uiglopj9k6g1p200
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: fixed-in
timestamp: Tue 2010-09-28 10:13:47 +0200
message:
Explain extract_bugs_from_entry assumptions.
-------------- next part --------------
=== modified file 'tools/fixed-in.py'
--- a/tools/fixed-in.py 2010-09-28 07:44:54 +0000
+++ b/tools/fixed-in.py 2010-09-28 08:13:47 +0000
@@ -52,8 +52,13 @@
return True
def extract_bugs_from_entry(self):
- # Not all entries will contain bugs and some entries are even garbage
- # that is not parsed (yet).
+ """Possibly extract bugs from a NEWS entry and yield them.
+
+ Not all entries will contain bugs and some entries are even garbage and
+ we don't try to parse them (yet). The trigger is a '#' and what looks
+ like a bug number inside parens to start with. From that we extract
+ authors (when present) and multiple bugs if needed.
+ """
# FIXME: Malone entries are different
# Join all entry lines to simplify multiple line matching
flat_entry = ' '.join(self.entry.splitlines())
@@ -61,8 +66,10 @@
for par in self.paren_exp_re.findall(flat_entry):
sharp = par.find('#')
if sharp is not None:
+ # We have at least one bug inside parens.
bugs = list(self.bugs_re.finditer(par))
if bugs:
+ # See where the first bug is mentioned
start = bugs[0].start()
end = bugs[-1].end()
if start == 0:
More information about the bazaar-commits
mailing list