Changeset - 4c9a295d80a4
[Not reviewed]
default
0 1 0
Marcin Kuzminski - 15 years ago 2010-07-01 20:02:06
marcin@python-works.com
added new command mappings for mercurial 1.6
1 file changed with 7 insertions and 6 deletions:
0 comments (0 inline, 0 general)
pylons_app/lib/middleware/simplehg.py
Show inline comments
 
@@ -140,30 +140,31 @@ class SimpleHg(object):
 
    def __make_app(self):
 
        hgserve = hgweb(self.repo_path)
 
        return  self.__load_web_settings(hgserve)
 
    
 
    def __get_environ_user(self, environ):
 
        return environ.get('REMOTE_USER')
 
        
 
    def __get_action(self, environ):
 
        """
 
        Maps mercurial request commands into a pull or push command.
 
        @param environ:
 
        """
 
        mapping = {
 
            'changegroup': 'pull',
 
            'changegroupsubset': 'pull',
 
            'unbundle': 'push',
 
            'stream_out': 'pull',
 
        }                    
 
        mapping = {'changegroup': 'pull',
 
                   'changegroupsubset': 'pull',
 
                   'stream_out': 'pull',
 
                   'listkeys': 'pull',
 
                   'unbundle': 'push',
 
                   'pushkey': 'push', }
 
        
 
        for qry in environ['QUERY_STRING'].split('&'):
 
            if qry.startswith('cmd'):
 
                cmd = qry.split('=')[-1]
 
                if mapping.has_key(cmd):
 
                    return mapping[cmd]
 
    
 
    def __log_user_action(self, user, action, repo):
 
        sa = meta.Session
 
        try:
 
            user_log = UserLog()
 
            user_log.user_id = user.user_id
 
            user_log.action = action
0 comments (0 inline, 0 general)