~matsubara/tarmac/bundle-lander-fixes

« back to all changes in this revision

Viewing changes to tarmac/bin/commands.py

  • Committer: Diogo Matsubara
  • Date: 2010-12-16 22:48:00 UTC
  • Revision ID: diogo.matsubara@canonical.com-20101216224800-u5p3jvs3xmp2co40
use a set rather than a list to collect proposals for the bundle lander.

Show diffs side-by-side

added added

removed removed

Lines of Context:
269
269
            # revno to restore to if bundle merge fails.
270
270
            restore_revno = target.tree.branch.revno() + 1
271
271
            results = target.merge_branches()
272
 
            collected_proposals = []
 
272
            # Use a set to collect the proposals. We don't want
 
273
            # duplicates since results generator will return the (source,
 
274
            # proposal) tuple twice, once for each pre and pos commit hook.
 
275
            collected_proposals = set()
273
276
            while True:
274
277
                try:
275
278
                    (hook, source, proposal) = results.next()
276
 
                    collected_proposals.append((source, proposal))
 
279
                    collected_proposals.add((source, proposal))
277
280
                    self._fire_merge_hook(
278
281
                        results, hook, target, source, proposal)
279
282
                except StopIteration: