Skip to content

Commit d298663

Browse files
committed
Retrieve tag information for Subversion repos
1 parent 5363a4c commit d298663

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

codespeed/commits/subversion.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ def updaterepo(project):
1313
return [{'error': False}]
1414

1515

16+
def get_tag(rev_num, repo_path, client):
17+
tags_url = repo_path + '/tags'
18+
tags = client.ls(tags_url)
19+
20+
for tag in tags:
21+
if 'created_rev' in tag and tag['created_rev'].number == rev_num:
22+
if 'name' in tag:
23+
return tag['name'].split('/')[-1]
24+
return ''
25+
26+
1627
def getlogs(newrev, startrev):
1728
import pysvn
1829

@@ -56,8 +67,10 @@ def get_login(realm, username, may_save):
5667
author = ""
5768
date = datetime.fromtimestamp(log.date).strftime("%Y-%m-%d %H:%M:%S")
5869
message = log.message
70+
tag = get_tag(log.revision.number,
71+
newrev.branch.project.repo_path, client)
5972
# Add log unless it is the last commit log, which has already been tested
6073
logs.append({
6174
'date': date, 'author': author, 'message': message,
62-
'commitid': log.revision.number})
75+
'commitid': log.revision.number, 'tag': tag})
6376
return logs

0 commit comments

Comments
 (0)