From f4a864b1a0e06e8f6c2a601596413d5636191640 Mon Sep 17 00:00:00 2001 From: nborisenko Date: Mon, 12 Jul 2021 20:31:16 +0300 Subject: [PATCH] Fix branches/tags for cloud usage --- atlassian/bitbucket/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/atlassian/bitbucket/__init__.py b/atlassian/bitbucket/__init__.py index 19cb76ac2..f9c73d06f 100644 --- a/atlassian/bitbucket/__init__.py +++ b/atlassian/bitbucket/__init__.py @@ -252,7 +252,10 @@ def upload_plugin(self, plugin_path): ################################################################################################ def _url_projects(self, api_root=None, api_version=None): + if self.cloud: + return self.resource_url("repositories", api_root, api_version) return self.resource_url("projects", api_root, api_version) + def project_list(self, start=0, limit=None): """ @@ -695,6 +698,8 @@ def get_project_audit_log(self, project_key, start=0, limit=None): return self._get_paged(url, params=params) def _url_repos(self, project_key, api_root=None, api_version=None): + if self.cloud: + return self._url_project(project_key, api_root, api_version) return "{}/repos".format(self._url_project(project_key, api_root, api_version)) def repo_list(self, project_key, start=0, limit=25): @@ -1052,6 +1057,8 @@ def get_repo_audit_log(self, project_key, repository_slug, start=0, limit=None): return self._get_paged(url, params=params) def _url_repo_branches(self, project_key, repository_slug, api_root=None): + if self.cloud: + return "{}/refs/branches".format(self._url_repo(project_key, repository_slug, api_root=api_root)) return "{}/branches".format(self._url_repo(project_key, repository_slug, api_root=api_root)) def get_branches(