Skip to content

Commit a97d29c

Browse files
authored
Bitbucket: Add get changed files in commit (#1130)
1 parent bac56a9 commit a97d29c

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

atlassian/bitbucket/__init__.py

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2190,7 +2190,41 @@ def get_commits(
21902190
if limit:
21912191
params["limit"] = limit
21922192
return self._get_paged(url, params=params)
2193-
2193+
2194+
def get_commit_changes(
2195+
self,
2196+
project_key,
2197+
repository_slug,
2198+
hash_newest=None,
2199+
merges="include",
2200+
commitId=None
2201+
):
2202+
"""
2203+
Get commit list from repo
2204+
:param project_key:
2205+
:param repository_slug:
2206+
:param hash_newest:
2207+
:param merges: OPTIONAL: include|exclude|only if present, controls how merge commits should be filtered.
2208+
:param commitId
2209+
:return:
2210+
"""
2211+
url = self._url_commit_c(project_key, repository_slug, commitId=commitId)
2212+
params = {"merges": merges}
2213+
if hash_newest:
2214+
params["until"] = hash_newest
2215+
return self.get(url, params=params)
2216+
2217+
def _url_commit_c(self, project_key, repository_slug, api_root=None, api_version=None, commitId=None):
2218+
return "{}/commits/{}/changes".format(
2219+
self._url_repo(
2220+
project_key,
2221+
repository_slug,
2222+
api_root=api_root,
2223+
api_version=api_version,
2224+
),
2225+
commitId
2226+
)
2227+
21942228
def _url_commit(
21952229
self,
21962230
project_key,

0 commit comments

Comments
 (0)