2

Python IDE用のMercurialサポートプラグインを作成しようとしていますが、APIを理解するのに多くの問題があります。現在、APIのさまざまなコマンドの使用法を理解するための実験を行っているだけですが、APIのドキュメントなどが見つかりません。

私の問題は、rがこの操作を行っていないため、r.changectxが機能しないことです。そして、changectx関数を使用する例がたくさんあります。

私の水銀バージョンは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())
4

1 に答える 1

3

そのように機能させるには、ローカルリポジトリが必要だと思います。また、のリビジョンが必要ですchangectx

from mercurial import ui, hg, commands

myui = ui.ui()
repourl = "https://ninja-ide.googlecode.com/hg/"

commands.clone(myui, repourl, 'ninja')
r = hg.repository(myui, './ninja')
c = r.changectx("tip")

# 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())

編集:このFAQエントリは、リモートリポジトリでは機能しないことを裏付けているようです。

于 2011-01-16T05:43:02.553 に答える