Rev 2984: Make CommitBuilder.heads be _heads as its internal to CommitBuilder only. in http://people.ubuntu.com/~robertc/baz2.0/commit.merge-speed

Robert Collins robertc at robertcollins.net
Tue Nov 27 22:51:43 GMT 2007


At http://people.ubuntu.com/~robertc/baz2.0/commit.merge-speed

------------------------------------------------------------
revno: 2984
revision-id:robertc at robertcollins.net-20071127225128-s5dr0ry09hj78kdl
parent: robertc at robertcollins.net-20071127222643-86fymmfpn6xw88up
committer: Robert Collins <robertc at robertcollins.net>
branch nick: commit.merge-speed
timestamp: Wed 2007-11-28 09:51:28 +1100
message:
  Make CommitBuilder.heads be _heads as its internal to CommitBuilder only.
modified:
  bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
  bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
=== modified file 'bzrlib/repofmt/pack_repo.py'
--- a/bzrlib/repofmt/pack_repo.py	2007-11-12 22:57:58 +0000
+++ b/bzrlib/repofmt/pack_repo.py	2007-11-27 22:51:28 +0000
@@ -87,7 +87,7 @@
             self._new_revision_id, new_lines, parents, nostore_sha,
             self.random_revid)
 
-    def heads(self, file_id, revision_ids):
+    def _heads(self, file_id, revision_ids):
         keys = [(file_id, revision_id) for revision_id in revision_ids]
         return set([key[1] for key in self._file_graph.heads(keys)])
 
@@ -113,7 +113,7 @@
             self._new_revision_id, new_lines, parents, nostore_sha,
             self.random_revid)
 
-    def heads(self, file_id, revision_ids):
+    def _heads(self, file_id, revision_ids):
         keys = [(file_id, revision_id) for revision_id in revision_ids]
         return set([key[1] for key in self._file_graph.heads(keys)])
 

=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py	2007-11-12 22:57:58 +0000
+++ b/bzrlib/repository.py	2007-11-27 22:51:28 +0000
@@ -116,7 +116,7 @@
             self._timezone = int(timezone)
 
         self._generate_revision_if_needed()
-        self._heads = graph.HeadsCache(repository.get_graph()).heads
+        self.__heads = graph.HeadsCache(repository.get_graph()).heads
 
     def commit(self, message):
         """Make the actual commit.
@@ -188,13 +188,13 @@
         else:
             self.random_revid = False
 
-    def heads(self, file_id, revision_ids):
+    def _heads(self, file_id, revision_ids):
         """Calculate the graph heads for revision_ids in the graph of file_id.
 
         This can use either a per-file graph or a global revision graph as we
         have an identity relationship between the two graphs.
         """
-        return self._heads(revision_ids)
+        return self.__heads(revision_ids)
 
     def _check_root(self, ie, parent_invs, tree):
         """Helper for record_entry_contents.
@@ -293,7 +293,7 @@
         # XXX: Friction: parent_candidates should return a list not a dict
         #      so that we don't have to walk the inventories again.
         parent_candiate_entries = ie.parent_candidates(parent_invs)
-        head_set = self.heads(ie.file_id, parent_candiate_entries.keys())
+        head_set = self._heads(ie.file_id, parent_candiate_entries.keys())
         heads = []
         for inv in parent_invs:
             if ie.file_id in inv:



More information about the bazaar-commits mailing list