|
@@ -46,6 +46,7 @@ Currently implemented:
|
|
* commit-tree
|
|
* commit-tree
|
|
* diff-tree
|
|
* diff-tree
|
|
* init
|
|
* init
|
|
|
|
+ * list-tags
|
|
* pull
|
|
* pull
|
|
* push
|
|
* push
|
|
* remove
|
|
* remove
|
|
@@ -374,6 +375,18 @@ def tag(repo, tag, author, message):
|
|
r.refs['refs/tags/' + tag] = tag_obj.id
|
|
r.refs['refs/tags/' + tag] = tag_obj.id
|
|
|
|
|
|
|
|
|
|
|
|
+def list_tags(repo, outstream=sys.stdout):
|
|
|
|
+ """List all tags.
|
|
|
|
+
|
|
|
|
+ :param repo: Path to repository
|
|
|
|
+ :param outstream: Stream to write tags to
|
|
|
|
+ """
|
|
|
|
+ r = open_repo(repo)
|
|
|
|
+ tags = list(r.refs.as_dict("refs/tags"))
|
|
|
|
+ tags.sort()
|
|
|
|
+ return tags
|
|
|
|
+
|
|
|
|
+
|
|
def reset(repo, mode, committish="HEAD"):
|
|
def reset(repo, mode, committish="HEAD"):
|
|
"""Reset current HEAD to the specified state.
|
|
"""Reset current HEAD to the specified state.
|
|
|
|
|