~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/mutabletree.py

  • Committer: Vincent Ladeuil
  • Date: 2010-02-10 16:41:09 UTC
  • mto: (5029.2.1 integration2)
  • mto: This revision was merged to the branch mainline in revision 5031.
  • Revision ID: v.ladeuil+lp@free.fr-20100210164109-q5wluu91am3vsf6d
Use a set() for conflicts_related to stay O(1).

Show diffs side-by-side

added added

removed removed

Lines of Context:
389
389
        ignored = {}
390
390
        dirs_to_add = []
391
391
        user_dirs = set()
392
 
        conflicts_related = []
 
392
        conflicts_related = set()
393
393
        # Not all mutable trees can have conflicts
394
394
        if getattr(self, 'conflicts', None) is not None:
395
395
            # Collect all related files without checking whether they exist or
396
396
            # are versioned. It's cheaper to do that once for all conflicts
397
397
            # than trying to find the relevant conflict for each added file.
398
398
            for c in self.conflicts():
399
 
                conflicts_related.extend(c.associated_filenames())
 
399
                conflicts_related.update(c.associated_filenames())
400
400
 
401
401
        # validate user file paths and convert all paths to tree
402
402
        # relative : it's cheaper to make a tree relative path an abspath