コード例 #1
0
ファイル: tag.py プロジェクト: release-depot/git_wrapper
    def names(self):
        """List git tags in the repository."""
        try:
            tags_list = [x.name for x in self.git_repo.repo.tags]
        except git.GitCommandError as ex:
            repo_path = self.git_repo.repo.working_dir
            msg = f"Error listing tags for {repo_path}. Error: {ex}"
            raise exceptions.TaggingException(msg) from ex

        return tags_list
コード例 #2
0
ファイル: tag.py プロジェクト: release-depot/git_wrapper
    def delete(self, name):
        """Delete tag from local repository

           :param str name: Tag name to delete
        """
        try:
            self.git_repo.git.tag("-d", name)
        except git.GitCommandError as ex:
            msg = f"Error deleting tag {name}. Error: {ex}"
            raise exceptions.TaggingException(msg) from ex
コード例 #3
0
ファイル: tag.py プロジェクト: cjeanner/git_wrapper
    def delete(self, name):
        """Delete tag from local repository

           :param str name: Tag name to delete
        """
        try:
            self.git_repo.git.tag("-d", name)
        except git.GitCommandError as ex:
            msg = "Error deleting tag {name}. Error: {error}".format(name=name,
                                                                     error=ex)
            raise_from(exceptions.TaggingException(msg), ex)
コード例 #4
0
ファイル: tag.py プロジェクト: jpichon/git_wrapper
    def names(self):
        """List git tags in the repository."""
        try:
            tags_list = [x.name for x in self.git_repo.repo.tags]
        except git.GitCommandError as ex:
            repo_path = self.git_repo.repo.working_dir
            msg = "Error listing tags for {repo}. Error: {error}".format(
                error=ex, repo=repo_path)
            raise_from(exceptions.TaggingException(msg), ex)

        return tags_list
コード例 #5
0
ファイル: tag.py プロジェクト: release-depot/git_wrapper
    def create(self, name, reference):
        """Create a new tag to the target reference.

           :param str name: New tag's name
           :param str reference: What the tag should point to
        """
        try:
            self.git_repo.repo.create_tag(name, reference)
        except git.GitCommandError as ex:
            msg = f"Error creating tag {name} on {reference}. Error: {ex}"
            raise exceptions.TaggingException(msg) from ex
コード例 #6
0
ファイル: tag.py プロジェクト: cjeanner/git_wrapper
    def create(self, name, reference):
        """Create a new tag to the target reference.

           :param str name: New tag's name
           :param str reference: What the tag should point to
        """
        try:
            self.git_repo.repo.create_tag(name, reference)
        except git.GitCommandError as ex:
            msg = "Error creating tag {name} on {ref}. Error: {error}".format(
                name=name, ref=reference, error=ex)
            raise_from(exceptions.TaggingException(msg), ex)