开发者

Display mercurial version with CGI

开发者 https://www.devze.com 2023-02-09 17:54 出处:网络
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.

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

精彩评论

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

关注公众号