# 文件锁
# 获取指定文件上的加锁信息
GET /api/v3/svn/projects/:id/locks
参数:
| 参数 | 类型 | 描述 |
|---|---|---|
| id | integer 或 string | 项目 ID 或 项目全路径 project_full_path |
| path | string | 路径 |
| user | string(可选) | 用户名 |
| per_page | integer(可选) | 默认页面大小 (默认值 20,最大值:100) |
| scroll_id | string(可选) | 滚动分页 |
返回值:
[
{
"path": "/tags/01.py",
"id": "72c123c6-0a92-11ee-9156-95f667376499",
"user": {
"id": 385488,
"username": "git_user",
"web_url": "https://git.tencent.com/u/git_user",
"name": "git_user",
"state": "active",
"avatar_url": "https://git.tencent.com/uploads/user/avatar/385488/thumb_0-7-334-334_aaf301d9a1494b9da22914b55df6cd66.png"
},
"timestamp": 1686733460182,
"message": "add ",
"scrollId": "72c123c6-0a92-11ee-9156-95f667376499"
}
]
# 锁定文件
PUT /api/v3/svn/projects/:id/locks/lock
参数:
| 参数 | 类型 | 描述 |
|---|---|---|
| id | integer 或 string | 项目 ID 或 项目全路径 project_full_path |
| path | string | 文件路径 |
| comment | string(可选) | 锁定信息 |
| force | boolean(可选) | 是否强制锁定,默认为 false 为 true 时,可覆盖之前的文件锁 |
返回值:
true
# 解锁文件
PUT /api/v3/svn/projects/:id/locks/unlock
参数:
| 参数 | 类型 | 描述 |
|---|---|---|
| id | integer 或 string | 项目 ID 或 项目全路径 project_full_path |
| path | string | 路径 |
| force | boolean(可选) | 是否强制解锁,默认为 false |
返回值:
true