vcs: commits, expose refs function to fetch commit refereces such as tags, bookmarks, etc.

This commit is contained in:
Marcin Kuzminski 2017-11-09 19:49:29 +01:00
parent 40e74de7a2
commit ec6a342178
2 changed files with 8 additions and 5 deletions

View file

@ -340,11 +340,7 @@ def get_repo_changeset(request, apiuser, repoid, revision,
_cs_json = cs.__json__()
_cs_json['diff'] = build_commit_data(cs, changes_details)
if changes_details == 'full':
_cs_json['refs'] = {
'branches': [cs.branch],
'bookmarks': getattr(cs, 'bookmarks', []),
'tags': cs.tags
}
_cs_json['refs'] = cs._get_refs()
return _cs_json

View file

@ -708,6 +708,13 @@ class BaseCommit(object):
'branch': self.branch
}
def _get_refs(self):
return {
'branches': [self.branch],
'bookmarks': getattr(self, 'bookmarks', []),
'tags': self.tags
}
@LazyProperty
def last(self):
"""