Rev 2713: Rename the indices/index pack list file to pack-names. in http://people.ubuntu.com/~robertc/baz2.0/repository

Robert Collins robertc at robertcollins.net
Sun Aug 12 23:22:19 BST 2007


At http://people.ubuntu.com/~robertc/baz2.0/repository

------------------------------------------------------------
revno: 2713
revision-id: robertc at robertcollins.net-20070812222213-u03i5fpr0m5b90gq
parent: robertc at robertcollins.net-20070812215248-wbyd7fn23w79iy4u
committer: Robert Collins <robertc at robertcollins.net>
branch nick: repository
timestamp: Mon 2007-08-13 08:22:13 +1000
message:
  Rename the indices/index pack list file to pack-names.
modified:
  bzrlib/repofmt/knitrepo.py     knitrepo.py-20070206081537-pyy4a00xdas0j4pf-1
  bzrlib/tests/test_repository.py test_repository.py-20060131075918-65c555b881612f4d
=== modified file 'bzrlib/repofmt/knitrepo.py'
--- a/bzrlib/repofmt/knitrepo.py	2007-08-12 21:52:48 +0000
+++ b/bzrlib/repofmt/knitrepo.py	2007-08-12 22:22:13 +0000
@@ -575,7 +575,7 @@
     def ensure_loaded(self):
         if self._names is None:
             self._names = set(node[1][0] for node in 
-                GraphIndex(self.transport, 'index').iter_all_entries())
+                GraphIndex(self.transport, 'pack-names').iter_all_entries())
 
     def allocate(self, name):
         if name in self._names:
@@ -711,7 +711,7 @@
         builder = GraphIndexBuilder()
         for name in self._names:
             builder.add_node((name, ), '')
-        self.transport.put_file('index', builder.finish())
+        self.transport.put_file('pack-names', builder.finish())
 
     def setup(self):
         # cannot add names if we're not in a 'write lock'.
@@ -1157,7 +1157,7 @@
         KnitRepository.__init__(self, _format, a_bzrdir, control_files,
                               _revision_store, control_store, text_store)
         index_transport = control_files._transport.clone('indices')
-        self._packs = RepositoryPackCollection(self, index_transport)
+        self._packs = RepositoryPackCollection(self, control_files._transport)
         self._revision_store = GraphKnitRevisionStore(self, index_transport, self._revision_store)
         self.weave_store = GraphKnitTextStore(self, index_transport, self.weave_store)
         self._inv_thunk = InventoryKnitThunk(self, index_transport)
@@ -1270,8 +1270,8 @@
                  control_store, text_store):
         KnitRepository3.__init__(self, _format, a_bzrdir, control_files,
                               _revision_store, control_store, text_store)
-        index_transport = a_bzrdir.get_repository_transport(None).clone('indices')
-        self._packs = RepositoryPackCollection(self, index_transport)
+        index_transport = control_files._transport.clone('indices')
+        self._packs = RepositoryPackCollection(self, control_files._transport)
         self._revision_store = GraphKnitRevisionStore(self, index_transport, self._revision_store)
         self.weave_store = GraphKnitTextStore(self, index_transport, self.weave_store)
         self._inv_thunk = InventoryKnitThunk(self, index_transport)
@@ -1626,7 +1626,7 @@
     repo_transport.mkdir('upload')
     repo_transport.rmdir('knits')
     builder = GraphIndexBuilder()
-    repo_transport.clone('indices').put_file('index', builder.finish())
+    repo_transport.put_file('pack-names', builder.finish())
     for knit in ('inventory', 'revisions', 'signatures'):
         repo_transport.delete(knit + '.kndx')
         repo_transport.delete(knit + '.knit')

=== modified file 'bzrlib/tests/test_repository.py'
--- a/bzrlib/tests/test_repository.py	2007-08-12 21:52:48 +0000
+++ b/bzrlib/tests/test_repository.py	2007-08-12 22:22:13 +0000
@@ -549,7 +549,7 @@
         self.assertFalse(t.has('knits'))
         # revision-indexes file-container directory
         self.assertEqual([],
-            list(GraphIndex(t.clone('indices'), 'index').iter_all_entries()))
+            list(GraphIndex(t, 'pack-names').iter_all_entries()))
         self.assertTrue(S_ISDIR(t.stat('packs').st_mode))
         self.assertTrue(S_ISDIR(t.stat('upload').st_mode))
 
@@ -597,9 +597,9 @@
         tree = self.make_branch_and_tree('.', format=format)
         trans = tree.branch.repository.bzrdir.get_repository_transport(None)
         self.assertEqual([],
-            list(GraphIndex(trans.clone('indices'), 'index').iter_all_entries()))
+            list(GraphIndex(trans, 'pack-names').iter_all_entries()))
         tree.commit('foobarbaz')
-        index = GraphIndex(trans.clone('indices'), 'index')
+        index = GraphIndex(trans, 'pack-names')
         self.assertEqual(1, len(list(index.iter_all_entries())))
         name = list(index.iter_all_entries())[0][1][0]
         self.assertTrue(trans.has('indices/%s.rix' % name))
@@ -610,9 +610,9 @@
         tree = self.make_branch_and_tree('.', format=format)
         trans = tree.branch.repository.bzrdir.get_repository_transport(None)
         self.assertEqual([],
-            list(GraphIndex(trans.clone('indices'), 'index').iter_all_entries()))
+            list(GraphIndex(trans, 'pack-names').iter_all_entries()))
         tree.commit('foobarbaz')
-        index = GraphIndex(trans.clone('indices'), 'index')
+        index = GraphIndex(trans, 'pack-names')
         self.assertEqual(1, len(list(index.iter_all_entries())))
         name = list(index.iter_all_entries())[0][1][0]
         self.assertTrue(trans.has('indices/%s.six' % name))
@@ -623,9 +623,9 @@
         tree = self.make_branch_and_tree('.', format=format)
         trans = tree.branch.repository.bzrdir.get_repository_transport(None)
         self.assertEqual([],
-            list(GraphIndex(trans.clone('indices'), 'index').iter_all_entries()))
+            list(GraphIndex(trans, 'pack-names').iter_all_entries()))
         tree.commit('foobarbaz')
-        index = GraphIndex(trans.clone('indices'), 'index')
+        index = GraphIndex(trans, 'pack-names')
         self.assertEqual(1, len(list(index.iter_all_entries())))
         name = list(index.iter_all_entries())[0][1][0]
         self.assertTrue(trans.has('indices/%s.iix' % name))
@@ -636,9 +636,9 @@
         tree = self.make_branch_and_tree('.', format=format)
         trans = tree.branch.repository.bzrdir.get_repository_transport(None)
         self.assertEqual([],
-            list(GraphIndex(trans.clone('indices'), 'index').iter_all_entries()))
+            list(GraphIndex(trans, 'pack-names').iter_all_entries()))
         tree.commit('foobarbaz')
-        index = GraphIndex(trans.clone('indices'), 'index')
+        index = GraphIndex(trans, 'pack-names')
         self.assertEqual(1, len(list(index.iter_all_entries())))
         name = list(index.iter_all_entries())[0][1][0]
         self.assertTrue(trans.has('indices/%s.tix' % name))
@@ -650,7 +650,7 @@
         tree1.branch.repository.fetch(tree2.branch.repository)
         trans = tree1.branch.repository.bzrdir.get_repository_transport(None)
         self.assertEqual([],
-            list(GraphIndex(trans.clone('indices'), 'index').iter_all_entries()))
+            list(GraphIndex(trans, 'pack-names').iter_all_entries()))
 
     def test_commit_across_pack_shape_boundary_autopacks(self):
         format = self.get_format()
@@ -664,11 +664,11 @@
         for x in range(9):
             tree.commit('commit %s' % x)
         # there should be 9 packs:
-        index = GraphIndex(trans.clone('indices'), 'index')
+        index = GraphIndex(trans, 'pack-names')
         self.assertEqual(9, len(list(index.iter_all_entries())))
         # committing one more should coalesce to 1 of 10.
         tree.commit('commit triggering pack')
-        index = GraphIndex(trans.clone('indices'), 'index')
+        index = GraphIndex(trans, 'pack-names')
         self.assertEqual(1, len(list(index.iter_all_entries())))
         # packing should not damage data
         tree = tree.bzrdir.open_workingtree()
@@ -679,7 +679,7 @@
         large_pack_name = list(index.iter_all_entries())[0][1][0]
         # finally, committing again should not touch the large pack.
         tree.commit('commit not triggering pack')
-        index = GraphIndex(trans.clone('indices'), 'index')
+        index = GraphIndex(trans, 'pack-names')
         self.assertEqual(2, len(list(index.iter_all_entries())))
         pack_names = [node[1][0] for node in index.iter_all_entries()]
         self.assertTrue(large_pack_name in pack_names)
@@ -692,7 +692,7 @@
         tree.commit('more work')
         tree.branch.repository.pack()
         # there should be 1 packs:
-        index = GraphIndex(trans.clone('indices'), 'index')
+        index = GraphIndex(trans, 'pack-names')
         self.assertEqual(1, len(list(index.iter_all_entries())))
         self.assertEqual(2, len(tree.branch.repository.all_revision_ids()))
 



More information about the bazaar-commits mailing list