Python hglib:是否可能显示修订版的修补程序?

Python hglib:是否可能显示修订版的修补程序?,python,mercurial,hglib,Python,Mercurial,Hglib,我正在尝试使用hglib获取给定版本的补丁。我知道hg命令是 hg日志-pr版本 但我找不到如何使用hglib实现这一点或类似的功能。似乎没有这样做的功能,除非我自己破解代码来运行上面的命令。非常感谢您的帮助。hglibclient.log()接口不支持我想做的事情,但我找到了一种运行任意hg命令的简单方法。这两行打印修订版本的补丁: out = client.rawcommand([b'log', b'-pr', b'%i'%rev]) print(str(out, 'utf-8')) hg

我正在尝试使用hglib获取给定版本的补丁。我知道hg命令是

hg日志-pr版本

但我找不到如何使用hglib实现这一点或类似的功能。似乎没有这样做的功能,除非我自己破解代码来运行上面的命令。非常感谢您的帮助。

hglib
client.log()
接口不支持我想做的事情,但我找到了一种运行任意hg命令的简单方法。这两行打印修订版本的补丁:

out = client.rawcommand([b'log', b'-pr', b'%i'%rev])
print(str(out, 'utf-8'))
hglib
client.log()。这两行打印修订版本的补丁:

out = client.rawcommand([b'log', b'-pr', b'%i'%rev])
print(str(out, 'utf-8'))

也许这才是真正的答案

import hglib
client = hglib.open(<path>)
client.export (revs = str(<revision number>), output = <output file path>)
导入hglib
client=hglib.open()
client.export(revs=str(),output=)

您可以自己使用子流程包执行相同的操作,以节省解释时间。Rawcommand只是使用我们传递的参数构建一个命令,并再次使用子流程执行

也许这才是真正的答案

import hglib
client = hglib.open(<path>)
client.export (revs = str(<revision number>), output = <output file path>)
导入hglib
client=hglib.open()
client.export(revs=str(),output=)
您可以自己使用子流程包执行相同的操作,以节省解释时间。Rawcommand只是使用我们传递的参数构建一个命令,并再次使用子流程执行