comparison hgext/bugzilla.py @ 8455:a858b54d072b

bugzilla: use set instead of dict
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Sun, 17 May 2009 03:02:12 +0200
parents 46293a0c7e9f
children 868670dbc237
comparison
equal deleted inserted replaced
8454:6d4bf1c1a003 8455:a858b54d072b
337 bugzilla._bug_re = re.compile( 337 bugzilla._bug_re = re.compile(
338 self.ui.config('bugzilla', 'regexp', bugzilla._default_bug_re), 338 self.ui.config('bugzilla', 'regexp', bugzilla._default_bug_re),
339 re.IGNORECASE) 339 re.IGNORECASE)
340 bugzilla._split_re = re.compile(r'\D+') 340 bugzilla._split_re = re.compile(r'\D+')
341 start = 0 341 start = 0
342 ids = {} 342 ids = set()
343 while True: 343 while True:
344 m = bugzilla._bug_re.search(ctx.description(), start) 344 m = bugzilla._bug_re.search(ctx.description(), start)
345 if not m: 345 if not m:
346 break 346 break
347 start = m.end() 347 start = m.end()
348 for id in bugzilla._split_re.split(m.group(1)): 348 for id in bugzilla._split_re.split(m.group(1)):
349 if not id: continue 349 if not id: continue
350 ids[int(id)] = 1 350 ids.add(int(id))
351 ids = ids.keys()
352 if ids: 351 if ids:
353 ids = self.filter_real_bug_ids(ids) 352 ids = self.filter_real_bug_ids(ids)
354 if ids: 353 if ids:
355 ids = self.filter_unknown_bug_ids(ctx.node(), ids) 354 ids = self.filter_unknown_bug_ids(ctx.node(), ids)
356 return ids 355 return ids