Пример #1
0
 def fetchFromArchive(self, target_path):
     """Fetch the foreign tree for `source_details` from the archive."""
     local_name = 'foreign_tree.tar.gz'
     if not self.import_data_store.fetch(local_name):
         raise NoSuchFile(local_name)
     extract_tarball(local_name, target_path)
     tree = self._getForeignTree(target_path)
     tree.update()
     return tree
Пример #2
0
 def fetchFromArchive(self, target_path):
     """Fetch the foreign tree for `source_details` from the archive."""
     local_name = 'foreign_tree.tar.gz'
     if not self.import_data_store.fetch(local_name):
         raise NoSuchFile(local_name)
     extract_tarball(local_name, target_path)
     tree = self._getForeignTree(target_path)
     tree.update()
     return tree
Пример #3
0
    def getBazaarBranch(self):
        """See `ToBzrImportWorker.getBazaarBranch`.

        In addition to the superclass' behaviour, we retrieve bzr-svn's
        cache from the import data store and put it where bzr-svn will find
        it.
        """
        from bzrlib.plugins.svn.cache import create_cache_dir
        branch = super(BzrSvnImportWorker, self).getBazaarBranch()
        local_name = 'svn-cache.tar.gz'
        if self.import_data_store.fetch(local_name):
            extract_tarball(local_name, create_cache_dir())
        return branch
Пример #4
0
    def getBazaarBranch(self):
        """See `ToBzrImportWorker.getBazaarBranch`.

        In addition to the superclass' behaviour, we retrieve bzr-git's
        caches, both legacy and modern, from the import data store and put
        them where bzr-git will find them in the Bazaar tree, that is at
        '.bzr/repository/git.db' and '.bzr/repository/git'.
        """
        branch = PullingImportWorker.getBazaarBranch(self)
        # Fetch the legacy cache from the store, if present.
        self.import_data_store.fetch('git.db', branch.repository._transport)
        # The cache dir from newer bzr-gits is stored as a tarball.
        local_name = 'git-cache.tar.gz'
        if self.import_data_store.fetch(local_name):
            repo_transport = branch.repository._transport
            repo_transport.mkdir('git')
            git_db_dir = os.path.join(local_path_from_url(repo_transport.base),
                                      'git')
            extract_tarball(local_name, git_db_dir)
        return branch
Пример #5
0
    def getBazaarBranch(self):
        """See `ImportWorker.getBazaarBranch`.

        In addition to the superclass' behaviour, we retrieve bzr-git's
        caches, both legacy and modern, from the import data store and put
        them where bzr-git will find them in the Bazaar tree, that is at
        '.bzr/repository/git.db' and '.bzr/repository/git'.
        """
        branch = PullingImportWorker.getBazaarBranch(self)
        # Fetch the legacy cache from the store, if present.
        self.import_data_store.fetch(
            'git.db', branch.repository._transport)
        # The cache dir from newer bzr-gits is stored as a tarball.
        local_name = 'git-cache.tar.gz'
        if self.import_data_store.fetch(local_name):
            repo_transport = branch.repository._transport
            repo_transport.mkdir('git')
            git_db_dir = os.path.join(
                local_path_from_url(repo_transport.base), 'git')
            extract_tarball(local_name, git_db_dir)
        return branch