开发者

Display mercurial version with CGI

I'm using mercurial on a shared hosting with hgwebdir cgi script.

Sometimes I'd like to check which version 开发者_高级运维of mercurial is there installed on the server. Is there any way to display mercurial version using CGI (like output of hg --version)?


https://www.mercurial-scm.org/wiki/ReferenceCycles

from mercurial import hg, ui, util
import os
import gc

def test():
    print "Mercurial version: %s" % util.version()
    repo = hg.repository(ui.ui(), os.getcwd())
    status = repo.status()
    print status

test()
print "gc.collect() returns %s" % gc.collect()
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜