src/mercurialserver/servelog.py
changeset 296 6feeef02c057
parent 295 9741d82e5b1e
child 307 9009a37ad45b
equal deleted inserted replaced
295:9741d82e5b1e 296:6feeef02c057
     7 import mercurial.node
     7 import mercurial.node
     8 
     8 
     9 import os
     9 import os
    10 import time
    10 import time
    11 import fcntl
    11 import fcntl
    12 try: import simplejson as json
    12 
    13 except ImportError: import json
    13 try: 
       
    14     import json
       
    15 except ImportError: 
       
    16     import simplejson as json
       
    17 
    14 from mercurialserver import ruleset, changes
    18 from mercurialserver import ruleset, changes
    15 
    19 
    16 def hook(ui, repo, hooktype, node=None, source=None, **kwargs):
    20 def hook(ui, repo, hooktype, node=None, source=None, **kwargs):
    17     if hooktype == 'changegroup':
    21     if hooktype == 'changegroup':
    18         op = "push"
    22         op = "push"
    34             nodes=[mercurial.node.hex(ctx.node())
    38             nodes=[mercurial.node.hex(ctx.node())
    35                 for ctx in changes.changes(repo, node)],
    39                 for ctx in changes.changes(repo, node)],
    36          )))
    40          )))
    37     finally:
    41     finally:
    38         log.close()
    42         log.close()
       
    43