您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

使用Mercurial脚本编写Python

使用Mercurial脚本编写Python

确实没有官方API,但是您可以通过阅读其他扩展(尤其是与hg捆绑在一起的扩展)来了解最佳做法。对于这个特殊的问题,我会做这样的事情:

from mercurial import ui, hg
from mercurial.node import hex

repo = hg.repository('/path/to/repo/root', ui.ui())
fctx = repo.filectx('/path/to/file', 'tip')
hexnode = hex(fctx.node())

在某些时候参数顺序已更改,现在是这样的:

   repo = hg.repository(ui.ui(), '/path/to/repo/root' )
python 2022/1/1 18:41:14 有263人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶