Skip to content

Commit

Permalink
Implemented Git.get_ancestral_tags()
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Jun 20, 2023
1 parent 588292e commit 45f32ef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ v1.1.0

Added ``repo()`` function.

Implemented ``Git.get_ancestral_tags()``.

v1.0.0
======

Expand Down
9 changes: 9 additions & 0 deletions jaraco/vcs/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,12 @@ def is_modified(self):
Is the current state modified? (currently stubbed assuming no)
"""
return False

def get_ancestral_tags(self, rev=None):
"""
Like get_repo_tags, but only get those tags ancestral to the current
changeset.
"""
rev = rev or 'HEAD'
matches = self._invoke('tags', '--merged', rev).splitlines()
return (rev for rev in self.get_repo_tags() if rev.tag in matches)

0 comments on commit 45f32ef

Please sign in to comment.