Rev 5018: Use a set() for conflicts_related to stay O(1). in file:///home/vila/src/bzr/bugs/322767-dont-add-conflict-related-files/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Wed Feb 10 16:41:10 GMT 2010
At file:///home/vila/src/bzr/bugs/322767-dont-add-conflict-related-files/
------------------------------------------------------------
revno: 5018
revision-id: v.ladeuil+lp at free.fr-20100210164109-q5wluu91am3vsf6d
parent: v.ladeuil+lp at free.fr-20100208163613-9sgl3ugvdxapwgw8
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 322767-dont-add-conflict-related-files
timestamp: Wed 2010-02-10 17:41:09 +0100
message:
Use a set() for conflicts_related to stay O(1).
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS 2010-02-08 16:36:13 +0000
+++ b/NEWS 2010-02-10 16:41:09 +0000
@@ -37,7 +37,7 @@
(Vincent Ladeuil, #516934)
* ``bzr add`` will not add conflict related files unless explicitly required.
- (Vincent Ladeuil, #322767)
+ (Vincent Ladeuil, #322767, #414589)
Testing
*******
=== modified file 'bzrlib/mutabletree.py'
--- a/bzrlib/mutabletree.py 2010-02-08 16:36:13 +0000
+++ b/bzrlib/mutabletree.py 2010-02-10 16:41:09 +0000
@@ -389,14 +389,14 @@
ignored = {}
dirs_to_add = []
user_dirs = set()
- conflicts_related = []
+ conflicts_related = set()
# Not all mutable trees can have conflicts
if getattr(self, 'conflicts', None) is not None:
# Collect all related files without checking whether they exist or
# are versioned. It's cheaper to do that once for all conflicts
# than trying to find the relevant conflict for each added file.
for c in self.conflicts():
- conflicts_related.extend(c.associated_filenames())
+ conflicts_related.update(c.associated_filenames())
# validate user file paths and convert all paths to tree
# relative : it's cheaper to make a tree relative path an abspath
More information about the bazaar-commits
mailing list