mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-14 06:17:18 +01:00
Implement obs_api.Package.cmd_fork()
This commit is contained in:
parent
699f4d860e
commit
8d94f068c0
@ -86,6 +86,33 @@ class Package(XmlModel):
|
||||
response = self.xml_request("PUT", apiurl, url_path, url_query, data=self.to_string())
|
||||
return Status.from_file(response, apiurl=apiurl)
|
||||
|
||||
@classmethod
|
||||
def cmd_fork(
|
||||
cls,
|
||||
apiurl: str,
|
||||
project: str,
|
||||
package: str,
|
||||
*,
|
||||
scmsync: str,
|
||||
):
|
||||
"""
|
||||
POST /source/{project}/{package}?cmd=fork&scmsync={scmsync}
|
||||
For a package managed in Git.
|
||||
|
||||
:param apiurl: Full apiurl or its alias.
|
||||
:param project: Project name.
|
||||
:param package: Package name.
|
||||
:param scmsync: Checkout Git URL. Example: https://src.example.com/owner/repo#branch
|
||||
"""
|
||||
|
||||
url_path = ["source", project, package]
|
||||
url_query = {
|
||||
"cmd": "fork",
|
||||
"scmsync": scmsync,
|
||||
}
|
||||
response = cls.xml_request("POST", apiurl, url_path, url_query)
|
||||
return Status.from_file(response, apiurl=apiurl)
|
||||
|
||||
@classmethod
|
||||
def cmd_release(
|
||||
cls,
|
||||
|
Loading…
x
Reference in New Issue
Block a user