質問

Python IDE用のMercurial Supportプラグインを作成しようとしていますが、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())
役に立ちましたか?

解決

そのように機能するためにはローカルリポジトリが必要だと思います。また、改訂が必要です 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エントリ リモートリポジトリでは機能しないと裏付けているようです。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top