2011-01-16 3 views
2

私はPython IDE用のMercurialサポートプラグインを作成しようとしています。私はAPIを理解するのに多くの問題があります。今、私はAPIのさまざまなコマンドの使用を理解するための実験を行っていますが、APIのドキュメントやそのようなものは見つかりません。Mercurial API:repo.changectx(変更)が存在しません!

私の問題は、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()) 

答えて

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

編集:this FAQ entryそれはリモートリポジトリ上で動作しないことを裏付けているようです。

+1

ありがとうございます:D、それは完璧に動作します! Mercurial APIに関する完全な(またはほぼ)ドキュメントをどこで見つけることができますか? – DraskyVanderhoff

+0

もう一度ありがとう:) – DraskyVanderhoff

関連する問題