Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Gerrit python api包设置提交消息错误_Python_Gerrit - Fatal编程技术网

使用Gerrit python api包设置提交消息错误

使用Gerrit python api包设置提交消息错误,python,gerrit,Python,Gerrit,链接到python gerrit api包的文档: 代码: 输入={ “消息”:“新提交消息\n\n更改Id:xxxxxxxxx\n” } change=gerrit.changes.get('xxxxxxxxx') 结果=更改。设置提交消息(输入) 错误: 当我尝试使用上述包设置提交消息时,我将“gerrit.utils.exceptions.NotFoundError:404客户端错误:Not Found”作为错误。这与您在其他问题中所问的问题相同。如果您有一个子-父项目,它将尝试以父/子

链接到python gerrit api包的文档:

代码:

输入={ “消息”:“新提交消息\n\n更改Id:xxxxxxxxx\n” }

change=gerrit.changes.get('xxxxxxxxx')

结果=更改。设置提交消息(输入)

错误:


当我尝试使用上述包设置提交消息时,我将“gerrit.utils.exceptions.NotFoundError:404客户端错误:Not Found”作为错误。

这与您在其他问题中所问的问题相同。如果您有一个子-父项目,它将尝试以父/子而不是父%2Fchild的身份访问该项目。这将导致错误404

有关修复方法,请参阅pull请求。见:

父子关系的一个例子是gerrit的代码所有者插件。插件存储库不包含任何代码,它更像一个包含子存储库的文件夹,这些子存储库通常会从父存储库继承访问权限

如果您查看下面的url,您可以看到该url使用%2F而不是正斜杠。这就是gerrit python api中不起作用的地方

这个例子适用于我上面的pull请求

input_ = {"message" : "New commit message\n\nChange-Id: I46554af336396ecb57d0c270c114a686439b5a66\n"}
c1 = gerrit.changes.get("12321")
print (c1)
c1.set_commit_message(input_)

endpoint=“/changes/%s/message”%quote(self.id)。我尝试在gerrit python api库的set_commit_message函数中更改端点值,但仍然得到错误消息您使用的url是什么?我在gerrit/__init__u;.py中添加了一些日志记录,以显示端点url和返回值。url:url应该是服务器/a/changes/Folder%2Fprojectname~branch~changeID/Message我在终端中收到404客户端错误以及以下链接:当我运行上述代码时。我看不到父项目和子项目的关系。但是GET请求在同一个链接上确实返回了答案。我从错误本身获得了链接,并通过邮递员得到了响应。