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
=== modified file 'NEWS'
--- NEWS 2009-05-18 21:48:44 +0000
+++ NEWS 2009-05-20 05:35:29 +0000
@@ -18,6 +18,8 @@
18Improvements18Improvements
19************19************
2020
21* ``bzr branch --notree`` is now faster. (Ian Clatworthy)
22
21Bug Fixes23Bug Fixes
22*********24*********
2325
2426
=== modified file 'bzrlib/revisiontree.py'
--- bzrlib/revisiontree.py 2009-05-06 05:36:28 +0000
+++ bzrlib/revisiontree.py 2009-05-20 05:35:29 +0000
@@ -45,7 +45,8 @@
45 self._rules_searcher = None45 self._rules_searcher = None
4646
47 def supports_tree_reference(self):47 def supports_tree_reference(self):
48 return True48 return getattr(self._repository._format, "supports_tree_reference",
49 False)
4950
50 def get_parent_ids(self):51 def get_parent_ids(self):
51 """See Tree.get_parent_ids.52 """See Tree.get_parent_ids.
5253
=== modified file 'bzrlib/tree.py'
--- bzrlib/tree.py 2009-05-07 05:08:46 +0000
+++ bzrlib/tree.py 2009-05-20 05:35:29 +0000
@@ -202,9 +202,10 @@
202 specific_file_ids=specific_file_ids)202 specific_file_ids=specific_file_ids)
203203
204 def iter_references(self):204 def iter_references(self):
205 for path, entry in self.iter_entries_by_dir():205 if self.supports_tree_reference():
206 if entry.kind == 'tree-reference':206 for path, entry in self.iter_entries_by_dir():
207 yield path, entry.file_id207 if entry.kind == 'tree-reference':
208 yield path, entry.file_id
208209
209 def kind(self, file_id):210 def kind(self, file_id):
210 raise NotImplementedError("Tree subclass %s must implement kind"211 raise NotImplementedError("Tree subclass %s must implement kind"