merge with crew-stable
authorDirkjan Ochtman <dirkjan@ochtman.nl>
Sat, 03 Jan 2009 21:24:31 +0100
changeset 7572 4f58147ea829
parent 7571 de7b12a23ba0 (current diff)
parent 7563 bbcd2dea19fe (diff)
child 7573 8bea01a65391
merge with crew-stable
mercurial/patch.py
--- a/mercurial/hgweb/hgweb_mod.py	Sat Jan 03 01:05:13 2009 +0100
+++ b/mercurial/hgweb/hgweb_mod.py	Sat Jan 03 21:24:31 2009 +0100
@@ -165,8 +165,9 @@
             ctype = tmpl('mimetype', encoding=self.encoding)
             ctype = templater.stringify(ctype)
 
-            # check allow_read / deny_read config options
-            self.check_perm(req, None)
+            # check read permissions non-static content
+            if cmd != 'static':
+                self.check_perm(req, None)
 
             if cmd == '':
                 req.form['cmd'] = [tmpl.cache['default']]
@@ -288,7 +289,7 @@
             raise ErrorResponse(HTTP_UNAUTHORIZED, 'read not authorized')
 
         if op == 'pull' and not self.allowpull:
-            raise ErrorResponse(HTTP_OK, '')
+            raise ErrorResponse(HTTP_UNAUTHORIZED, 'pull not authorized')
         # op is None when checking allow/deny_read permissions for a web-browser request
         elif op == 'pull' or op is None:
             return
--- a/mercurial/patch.py	Sat Jan 03 01:05:13 2009 +0100
+++ b/mercurial/patch.py	Sat Jan 03 21:24:31 2009 +0100
@@ -35,7 +35,7 @@
         except IOError:
             raise util.Abort(
                 _("cannot create %s: unable to create destination directory")
-                % dst)            
+                % dst)
 
     util.copyfile(abssrc, absdst)
 
--- a/tests/test-pull-http.out	Sat Jan 03 01:05:13 2009 +0100
+++ b/tests/test-pull-http.out	Sat Jan 03 21:24:31 2009 +0100
@@ -2,11 +2,11 @@
 updating working directory
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 % expect error, cloning not allowed
-abort: error: 
+abort: authorization failed
 requesting all changes
 % serve errors
 % expect error, pulling not allowed
-abort: error: 
+abort: authorization failed
 pulling from http://localhost/
 searching for changes
 % serve errors