diff --git a/atlassian/bitbucket/__init__.py b/atlassian/bitbucket/__init__.py index e5f3acb20..5940ebcbc 100644 --- a/atlassian/bitbucket/__init__.py +++ b/atlassian/bitbucket/__init__.py @@ -2168,6 +2168,8 @@ def get_commits( avatar_size=None, avatar_scheme=None, limit=None, + until=None, + since=None, ): """ Get commit list from repo @@ -2183,6 +2185,8 @@ def get_commits( :param avatar_scheme: OPTIONAL: the desired scheme for the avatar URL :param limit: OPTIONAL: The limit of the number of commits to return, this may be restricted by fixed system limits. Default by built-in method: None + :param until: OPTIONAL: The commit ID or ref (inclusively) to retrieve commits before + :param since: OPTIONAL: The commit ID or ref (exclusively) to retrieve commits after :return: """ url = self._url_commits(project_key, repository_slug) @@ -2203,6 +2207,12 @@ def get_commits( params["avatarScheme"] = avatar_scheme if limit: params["limit"] = limit + if self.cloud and (since or until): + raise Exception("Not supported in Bitbucket Cloud") + if since: + params["since"] = since + if until: + params["until"] = until return self._get_paged(url, params=params) def get_commit_changes(self, project_key, repository_slug, hash_newest=None, merges="include", commit_id=None):