Reputation: 7614
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
)?
Upvotes: 2
Views: 100
Reputation: 1279
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()
Upvotes: 2