Rev 4033: Remove InterPackToRemotePack - unneeded now. in http://people.ubuntu.com/~robertc/baz2.0/push.roundtrips

Robert Collins robertc at robertcollins.net
Mon Feb 23 02:32:37 GMT 2009


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

------------------------------------------------------------
revno: 4033
revision-id: robertc at robertcollins.net-20090223023234-dxi367x2fdtqfksg
parent: pqm at pqm.ubuntu.com-20090223012623-0epa5dpnb7sk0tef
committer: Robert Collins <robertc at robertcollins.net>
branch nick: push.roundtrips
timestamp: Mon 2009-02-23 13:32:34 +1100
message:
  Remove InterPackToRemotePack - unneeded now.
=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py	2009-02-22 23:58:54 +0000
+++ b/bzrlib/repository.py	2009-02-23 02:32:34 +0000
@@ -3414,10 +3414,15 @@
         self._ensure_real_inter()
         self._real_inter.copy_content(revision_id=revision_id)
 
+    @needs_write_lock
     def fetch(self, revision_id=None, pb=None, find_ghosts=False):
-        self._ensure_real_inter()
-        return self._real_inter.fetch(revision_id=revision_id, pb=pb,
-            find_ghosts=find_ghosts)
+        """See InterRepository.fetch()."""
+        # Always fetch using the generic streaming fetch code, to allow
+        # streaming fetching into remote servers.
+        from bzrlib.fetch import RepoFetcher
+        fetcher = RepoFetcher(self.target, self.source, revision_id,
+                              pb, find_ghosts)
+        return fetcher.count_copied, fetcher.failed_revisions
 
     @classmethod
     def _get_repo_format_to_test(self):
@@ -3462,50 +3467,6 @@
         return None
 
 
-
-class InterPackToRemotePack(InterPackRepo):
-    """A specialisation of InterPackRepo for a target that is a
-    RemoteRepository.
-
-    This will use the get_parent_map RPC rather than plain readvs, and also
-    uses an RPC for autopacking.
-    """
-
-    _walk_to_common_revisions_batch_size = 50
-
-    @staticmethod
-    def is_compatible(source, target):
-        from bzrlib.repofmt.pack_repo import RepositoryFormatPack
-        if isinstance(source._format, RepositoryFormatPack):
-            if isinstance(target, remote.RemoteRepository):
-                target._ensure_real()
-                if isinstance(target._real_repository._format,
-                              RepositoryFormatPack):
-                    if InterRepository._same_model(source, target):
-                        return True
-        return False
-    
-    def _autopack(self):
-        self.target.autopack()
-
-    @needs_write_lock
-    def fetch(self, revision_id=None, pb=None, find_ghosts=False):
-        """See InterRepository.fetch()."""
-        # Always fetch using the generic streaming fetch code, to allow
-        # streaming fetching into remote servers.
-        from bzrlib.fetch import RepoFetcher
-        fetcher = RepoFetcher(self.target, self.source, revision_id,
-                              pb, find_ghosts)
-        return fetcher.count_copied, fetcher.failed_revisions
-        
-    def _get_target_pack_collection(self):
-        return self.target._real_repository._pack_collection
-
-    @classmethod
-    def _get_repo_format_to_test(self):
-        return None
-
-
 InterRepository.register_optimiser(InterDifferingSerializer)
 InterRepository.register_optimiser(InterSameDataRepository)
 InterRepository.register_optimiser(InterWeaveRepo)
@@ -3515,7 +3476,6 @@
 InterRepository.register_optimiser(InterPackRepo)
 InterRepository.register_optimiser(InterOtherToRemote)
 InterRepository.register_optimiser(InterRemoteToOther)
-InterRepository.register_optimiser(InterPackToRemotePack)
 
 
 class CopyConverter(object):




More information about the bazaar-commits mailing list