diff -r 31d5c6236f71 -r f597eb3b5aaf src/mercurialserver/servelog.py --- a/src/mercurialserver/servelog.py Sun Dec 19 09:49:18 2010 +0000 +++ b/src/mercurialserver/servelog.py Tue Sep 06 11:16:58 2011 +0100 @@ -9,7 +9,13 @@ import os import time import fcntl -import json + +try: + import json + json.dumps +except ImportError: + import simplejson as json + from mercurialserver import ruleset, changes def hook(ui, repo, hooktype, node=None, source=None, **kwargs): @@ -25,13 +31,13 @@ fcntl.flock(log.fileno(), fcntl.LOCK_EX) log.seek(0, os.SEEK_END) # YAML log file format - log.write("- {0}\n".format(json.dumps(dict( + log.write("- %s\n" % json.dumps(dict( timestamp=time.strftime("%Y-%m-%d_%H:%M:%S Z", time.gmtime()), op=op, key=ruleset.rules.get('user'), ssh_connection=os.environ['SSH_CONNECTION'], nodes=[mercurial.node.hex(ctx.node()) for ctx in changes.changes(repo, node)], - )))) + ))) finally: log.close()