def get_repo(alias, url):
    """Returns a git repository object initialized for usage.
    """

    repo = GitRepo(url)
    repo.get_revs()
    repo.get_head()

    hasher = _digest()
    hasher.update(repo.path)
    repo.hash = hasher.hexdigest()

    repo.get_base_path = lambda base: os.path.join(
        base, 'info', 'fast-import', repo.hash)

    prefix = 'refs/testgit/%s/' % alias
    debug("prefix: '%s'", prefix)

    repo.gitdir = ""
    repo.alias = alias
    repo.prefix = prefix

    repo.exporter = GitExporter(repo)
    repo.importer = GitImporter(repo)
    repo.non_local = NonLocalGit(repo)

    return repo
Exemple #2
0
def get_repo(alias, url):
    """Returns a git repository object initialized for usage.
    """

    repo = GitRepo(url)
    repo.get_revs()
    repo.get_head()

    hasher = _digest()
    hasher.update(repo.path)
    repo.hash = hasher.hexdigest()

    repo.get_base_path = lambda base: os.path.join(base, 'info', 'fast-import',
                                                   repo.hash)

    prefix = 'refs/testgit/%s/' % alias
    debug("prefix: '%s'", prefix)

    repo.gitdir = ""
    repo.alias = alias
    repo.prefix = prefix

    repo.exporter = GitExporter(repo)
    repo.importer = GitImporter(repo)
    repo.non_local = NonLocalGit(repo)

    return repo
Exemple #3
0
    def local_repo(self, repo, path):
        """Returns a git repository object initalized for usage.
        """

        local = GitRepo(path)

        self.setup_local_repo(local, repo)

        local.exporter = GitExporter(local)
        local.importer = GitImporter(local)

        return local
Exemple #4
0
    def local_repo(self, repo, path):
        """Returns a git repository object initalized for usage.
        """

        local = GitRepo(path)

        self.setup_local_repo(local, repo)

        local.exporter = GitExporter(local)
        local.importer = GitImporter(local)

        return local
Exemple #5
0
def local_repo(repo, path):
    """Returns a git repository object initalized for usage.
    """

    local = GitRepo(path)

    local.non_local = None
    local.gitdir = repo.gitdir
    local.alias = repo.alias
    local.prefix = repo.prefix
    local.hash = repo.hash
    local.get_base_path = repo.get_base_path
    local.exporter = GitExporter(local)
    local.importer = GitImporter(local)

    return local
def local_repo(repo, path):
    """Returns a git repository object initalized for usage.
    """

    local = GitRepo(path)

    local.non_local = None
    local.gitdir = repo.gitdir
    local.alias = repo.alias
    local.prefix = repo.prefix
    local.hash = repo.hash
    local.get_base_path = repo.get_base_path
    local.exporter = GitExporter(local)
    local.importer = GitImporter(local)

    return local
Exemple #7
0
    def get_repo(self, alias, url):
        """Returns a git repository object initialized for usage.
        """

        repo = GitRepo(url)
        repo.get_revs()
        repo.get_head()

        prefix = 'refs/testgit/%s/' % alias
        debug("prefix: '%s'", prefix)

        repo.marksfile = 'testgit.marks'
        repo.prefix = prefix

        self.setup_repo(repo, alias)

        repo.exporter = GitExporter(repo)
        repo.importer = GitImporter(repo)
        repo.non_local = NonLocalGit(repo)

        return repo
Exemple #8
0
    def get_repo(self, alias, url):
        """Returns a git repository object initialized for usage.
        """

        repo = GitRepo(url)
        repo.get_revs()
        repo.get_head()

        prefix = 'refs/testgit/%s/' % alias
        debug("prefix: '%s'", prefix)

        repo.marksfile = 'testgit.marks'
        repo.prefix = prefix

        self.setup_repo(repo, alias)

        repo.exporter = GitExporter(repo)
        repo.importer = GitImporter(repo)
        repo.non_local = NonLocalGit(repo)

        return repo