def refresh_repositories(self, msg, args): config = RepoConfig(REPOSITORY_CONFIG_FILE) branches = config.get_repository(REPOSITORY_NAME)["branches"] for branch in branches: cmd = GitCommand(branch["path"]) cmd.pull() yield ("{} had been updated.".format((branch["path"])))
def _get_git_commander(self, repo): return GitCommand(repo, self._git_path)
def checkout_branch(self, repository_name, branch_name): branch_item = self._get_repo_path(repository_name, branch_name) cmd = GitCommand(branch_item['path']) cmd.checkout(branch_item['value']) cmd.pull() return branch_item
#/usr/bin/env python3 from gitutil.configure import Configuration from gitutil.commands import GitCommand import os REPOSITORY_CONFIG_FILE = os.getenv("REPOSITORY_CONFIG_FILE") REPOSITORY_NAME = os.getenv("REPOSITORY") config = Configuration(REPOSITORY_CONFIG_FILE) for branch in config["branches"]: cmd = GitCommand(branch["path"]) cmd.pull()