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()
精彩评论