Example #1
0
    def pushBazaarBranch(self, bazaar_branch, remote_branch=None):
        """See `ToBzrImportWorker.pushBazaarBranch`.

        In addition to the superclass' behaviour, we store bzr-git's cache
        directory at .bzr/repository/git in the import data store.
        """
        non_trivial = PullingImportWorker.pushBazaarBranch(self, bazaar_branch)
        repo_base = bazaar_branch.repository._transport.base
        git_db_dir = os.path.join(local_path_from_url(repo_base), 'git')
        local_name = 'git-cache.tar.gz'
        create_tarball(git_db_dir, local_name)
        self.import_data_store.put(local_name)
        return non_trivial
Example #2
0
    def pushBazaarBranch(self, bazaar_branch):
        """See `ImportWorker.pushBazaarBranch`.

        In addition to the superclass' behaviour, we store bzr-git's cache
        directory at .bzr/repository/git in the import data store.
        """
        non_trivial = PullingImportWorker.pushBazaarBranch(
            self, bazaar_branch)
        repo_base = bazaar_branch.repository._transport.base
        git_db_dir = os.path.join(local_path_from_url(repo_base), 'git')
        local_name = 'git-cache.tar.gz'
        create_tarball(git_db_dir, local_name)
        self.import_data_store.put(local_name)
        return non_trivial
Example #3
0
    def pushBazaarBranch(self, bazaar_branch, remote_branch=None):
        """See `ToBzrImportWorker.pushBazaarBranch`.

        In addition to the superclass' behaviour, we store bzr-svn's cache
        directory in the import data store.
        """
        from bzrlib.plugins.svn.cache import get_cache
        non_trivial = super(BzrSvnImportWorker,
                            self).pushBazaarBranch(bazaar_branch)
        if remote_branch is not None:
            cache = get_cache(remote_branch.repository.uuid)
            cache_dir = cache.create_cache_dir()
            local_name = 'svn-cache.tar.gz'
            create_tarball(os.path.dirname(cache_dir),
                           local_name,
                           filenames=[os.path.basename(cache_dir)])
            self.import_data_store.put(local_name)
            # XXX cjwatson 2019-02-06: Once this is behaving well on
            # production, consider removing the local cache after pushing a
            # copy of it to the import data store.
        return non_trivial
Example #4
0
 def archive(self, foreign_tree):
     """Archive the foreign tree."""
     local_name = 'foreign_tree.tar.gz'
     create_tarball(foreign_tree.local_path, 'foreign_tree.tar.gz')
     self.import_data_store.put(local_name)
Example #5
0
 def archive(self, foreign_tree):
     """Archive the foreign tree."""
     local_name = 'foreign_tree.tar.gz'
     create_tarball(foreign_tree.local_path, 'foreign_tree.tar.gz')
     self.import_data_store.put(local_name)