if duplicate bug not in recheckwatch, add it in
I19b25bb9595330393e664e9499204083b18ab5c9 added support delete duplicate bugs, but it didn't make sure the duplicate bug was already tracked in recheckwatch. Change-Id: I46bd034990e4470fcaf072da45ca55886ad3ba7d
This commit is contained in:
parent
154d4a5df8
commit
b563b4a514
@ -126,14 +126,19 @@ class Scoreboard(threading.Thread):
|
|||||||
project = change_record.get('project')
|
project = change_record.get('project')
|
||||||
bugno = int(m.group('bugno'))
|
bugno = int(m.group('bugno'))
|
||||||
hit = Hit(project, change)
|
hit = Hit(project, change)
|
||||||
|
bug = self._get_bug(bugno)
|
||||||
|
bug.addHit(hit)
|
||||||
|
self.scores[bugno] = bug
|
||||||
|
self.update()
|
||||||
|
|
||||||
|
def _get_bug(self, bugno):
|
||||||
|
""""Get latest bug information and create bug if not in score."""
|
||||||
bug = self.scores.get(bugno)
|
bug = self.scores.get(bugno)
|
||||||
if not bug:
|
if not bug:
|
||||||
bug = Bug(bugno)
|
bug = Bug(bugno)
|
||||||
else:
|
else:
|
||||||
bug.update()
|
bug.update()
|
||||||
bug.addHit(hit)
|
return bug
|
||||||
self.scores[bugno] = bug
|
|
||||||
self.update()
|
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
# Check for duplicate bugs
|
# Check for duplicate bugs
|
||||||
@ -142,7 +147,10 @@ class Scoreboard(threading.Thread):
|
|||||||
if bug.duplicate_of:
|
if bug.duplicate_of:
|
||||||
dupes.append(bugno)
|
dupes.append(bugno)
|
||||||
for bugno in dupes:
|
for bugno in dupes:
|
||||||
self.scores[self.scores[bugno].duplicate_of].addHits(self.scores[bugno].hits)
|
dupno = self.scores[bugno].duplicate_of
|
||||||
|
bug = self._get_bug(dupno)
|
||||||
|
bug.addHits(self.scores[bugno].hits)
|
||||||
|
self.scores[dupno] = bug
|
||||||
del self.scores[bugno]
|
del self.scores[bugno]
|
||||||
|
|
||||||
# Remove bugs that haven't been seen in ages
|
# Remove bugs that haven't been seen in ages
|
||||||
|
Loading…
x
Reference in New Issue
Block a user