##// END OF EJS Templates
Fixed journal action loggin doubled messages.
marcink -
r606:f31f1327 default
parent child Browse files
Show More
@@ -101,11 +101,12 b' class SimpleHg(object):'
101 (user, repo_name):
101 (user, repo_name):
102 return HTTPForbidden()(environ, start_response)
102 return HTTPForbidden()(environ, start_response)
103
103
104 #log action
104 #log action
105 proxy_key = 'HTTP_X_REAL_IP'
105 if action in ('push', 'pull', 'clone'):
106 def_key = 'REMOTE_ADDR'
106 proxy_key = 'HTTP_X_REAL_IP'
107 ipaddr = environ.get(proxy_key, environ.get(def_key, '0.0.0.0'))
107 def_key = 'REMOTE_ADDR'
108 self.__log_user_action(user, action, repo_name, ipaddr)
108 ipaddr = environ.get(proxy_key, environ.get(def_key, '0.0.0.0'))
109 self.__log_user_action(user, action, repo_name, ipaddr)
109
110
110 #===================================================================
111 #===================================================================
111 # MERCURIAL REQUEST HANDLING
112 # MERCURIAL REQUEST HANDLING
@@ -165,14 +166,14 b' class SimpleHg(object):'
165
166
166 def __get_action(self, environ):
167 def __get_action(self, environ):
167 """
168 """
168 Maps mercurial request commands into a pull or push command.
169 Maps mercurial request commands into a clone,pull or push command.
169 This should return generally always something
170 This should always return a valid command string
170 :param environ:
171 :param environ:
171 """
172 """
172 mapping = {'changegroup': 'pull',
173 mapping = {'changegroup': 'pull',
173 'changegroupsubset': 'pull',
174 'changegroupsubset': 'pull',
174 'stream_out': 'pull',
175 'stream_out': 'pull',
175 'listkeys': 'pull',
176 #'listkeys': 'pull',
176 'unbundle': 'push',
177 'unbundle': 'push',
177 'pushkey': 'push', }
178 'pushkey': 'push', }
178 for qry in environ['QUERY_STRING'].split('&'):
179 for qry in environ['QUERY_STRING'].split('&'):
General Comments 0
You need to be logged in to leave comments. Login now