Rev 2758: Clean up duplicate index_transport variables in http://sourcefrog.net/bzr/pack-repository

Martin Pool mbp at sourcefrog.net
Fri Sep 21 07:47:12 BST 2007


At http://sourcefrog.net/bzr/pack-repository

------------------------------------------------------------
revno: 2758
revision-id: mbp at sourcefrog.net-20070921064711-6cghit2xbstwq8gr
parent: mbp at sourcefrog.net-20070921064308-3ffuutrtw7tyzhhd
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: pack-repository
timestamp: Fri 2007-09-21 16:47:11 +1000
message:
  Clean up duplicate index_transport variables
modified:
  bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
=== modified file 'bzrlib/repofmt/pack_repo.py'
--- a/bzrlib/repofmt/pack_repo.py	2007-09-21 06:43:08 +0000
+++ b/bzrlib/repofmt/pack_repo.py	2007-09-21 06:47:11 +0000
@@ -374,7 +374,7 @@
         result.name = new_name
         result.transport = self._upload_transport.clone('../packs/')
         # write indices
-        index_transport = self._upload_transport.clone('../indices')
+        index_transport = self._index_transport
         rev_index_name = self.repo._revision_store.name_to_revision_index_name(new_name)
         revision_index_length = index_transport.put_file(rev_index_name,
             revision_index.finish())
@@ -713,9 +713,11 @@
             pack_detail[0].rename(pack_detail[1],
                 '../obsolete_packs/' + pack_detail[1])
             basename = pack_detail[1][:-4]
-            index_transport = pack_detail[0].clone('../indices')
+            # TODO: Probably needs to know all possible indexes for this pack
+            # - or maybe list the directory and move all indexes matching this
+            # name whether we recognize it or not?
             for suffix in ('iix', 'six', 'tix', 'rix'):
-                index_transport.rename(basename + suffix,
+                self._index_transport.rename(basename + suffix,
                     '../obsolete_packs/' + basename + suffix)
 
     def pack_distribution(self, total_revisions):




More information about the bazaar-commits mailing list