def release(self, version: str, message: str, remote: Remote) -> bool: tag = Tag(version) tag.create(message) remote.push(tag) extraCommand = self.config.getExtraReleaseCommand() if extraCommand is not None: cli = simpcli.Command(True) cli.execute(extraCommand) return True
def release(self, version: str, message: str, remote: Remote) -> bool: tag = Tag(version) tag.create(message) remote.push(tag) extraCommand = self.config.getExtraReleaseCommand() if extraCommand is not None: cli = simpcli.Command(True) cli.execute( extraCommand ) return True
def getRequestedBranch(self, branch: str) -> [Branch, Tag]: tagPrefix = self.config.getTag() if branch.startswith(tagPrefix): branch = Tag(branch) else: branch = Branch(branch) return branch
def getTags(self) -> List[Tag]: output = self.cli.execute('git tag -l') if not output: return [] lines = output.split("\n") tags = [] for line in lines: tag = line.strip() if tag not in tags: tags.append(tag) tagObjects = [] tags.sort() for tag in tags: tagObject = Tag(tag) tagObjects.append(tagObject) return tagObjects
def getLatestTag(self) -> [Branch, Tag]: output = self.cli.execute("git describe --abbrev=0") if not output: return Branch(self.config.getMaster()) return Tag(output.strip())
def hasTag(self, tag: Tag) -> bool: self.readTags() if tag.getName() in self.tags: return True return False