Merge lp:~bzr/bzr/faster-branch-notree into lp:~bzr/bzr/trunk-old

Proposed by Ian Clatworthy
Status: Superseded
Proposed branch: lp:~bzr/bzr/faster-branch-notree
Merge into: lp:~bzr/bzr/trunk-old
Diff against target: 44 lines
To merge this branch: bzr merge lp:~bzr/bzr/faster-branch-notree
Reviewer Review Type Date Requested Status
Bazaar Developers Pending
Review via email: mp+6664@code.launchpad.net

This proposal has been superseded by a proposal from 2009-05-20.

To post a comment you must log in.
Revision history for this message
Ian Clatworthy (ian-clatworthy) wrote :

This patch improve the performance of branch --no-tree. On the OpenOffice trunk, the time improves from 2 minutes to 0.2 seconds.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NEWS'
2--- NEWS 2009-05-18 21:48:44 +0000
3+++ NEWS 2009-05-20 05:35:29 +0000
4@@ -18,6 +18,8 @@
5 Improvements
6 ************
7
8+* ``bzr branch --notree`` is now faster. (Ian Clatworthy)
9+
10 Bug Fixes
11 *********
12
13
14=== modified file 'bzrlib/revisiontree.py'
15--- bzrlib/revisiontree.py 2009-05-06 05:36:28 +0000
16+++ bzrlib/revisiontree.py 2009-05-20 05:35:29 +0000
17@@ -45,7 +45,8 @@
18 self._rules_searcher = None
19
20 def supports_tree_reference(self):
21- return True
22+ return getattr(self._repository._format, "supports_tree_reference",
23+ False)
24
25 def get_parent_ids(self):
26 """See Tree.get_parent_ids.
27
28=== modified file 'bzrlib/tree.py'
29--- bzrlib/tree.py 2009-05-07 05:08:46 +0000
30+++ bzrlib/tree.py 2009-05-20 05:35:29 +0000
31@@ -202,9 +202,10 @@
32 specific_file_ids=specific_file_ids)
33
34 def iter_references(self):
35- for path, entry in self.iter_entries_by_dir():
36- if entry.kind == 'tree-reference':
37- yield path, entry.file_id
38+ if self.supports_tree_reference():
39+ for path, entry in self.iter_entries_by_dir():
40+ if entry.kind == 'tree-reference':
41+ yield path, entry.file_id
42
43 def kind(self, file_id):
44 raise NotImplementedError("Tree subclass %s must implement kind"