Mercurial API:repo.changectx(change) 不存在!
我正在尝试为 Python IDE 制作 Mercurial 支持插件,但在理解 API 方面遇到了很多困难。现在我只是做实验来理解 api 的不同命令的用法,但我找不到 api 的文档或类似的东西。
我的问题是 r.changectx 不起作用,因为 r 没有此操作。我看到很多使用 Changectx 函数的例子。
我的 Mercurial 版本是 1.7.3 。多谢 !!
from mercurial import ui, hg
r = hg.repository(ui.ui(), "https://ninja-ide.googlecode.com/hg/")
c = r.changectx("setup.py")
# show some information about the changeset
print c # represented as the changeset hash
print c.user()
print c.description()
print
# let's take a peek at the files
files = c.files()
for f in files:
fc = c[f]
print " ", f, len(fc.data())
i'm trying to make a Mercurial support plugin for a Python IDE and i have a lot of troubles understanding the API. Right now i'm only making experiments for understanding the uses of the different commands of the api, but i can't find the api's doc or anything like it.
My problem is that r.changectx doesn't work because r hasn't this operation. And i see a lot of examples that use the changectx function.
My mercurial version is 1.7.3 . Thanks a lot !!
from mercurial import ui, hg
r = hg.repository(ui.ui(), "https://ninja-ide.googlecode.com/hg/")
c = r.changectx("setup.py")
# show some information about the changeset
print c # represented as the changeset hash
print c.user()
print c.description()
print
# let's take a peek at the files
files = c.files()
for f in files:
fc = c[f]
print " ", f, len(fc.data())
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为它需要一个本地存储库才能像这样工作。此外,您还需要对
changectx
进行修订。编辑:此常见问题解答条目 似乎证实它不适用于远程存储库。
I think it needs a local repo for it to work like that. Also, you need a revision for
changectx
.Edit: this FAQ entry seems to corroborate that it won't work on remote repositories.