# HG changeset patch # User mpm@selenic.com # Date 1124518360 28800 # Node ID 3f37720e7dc717d76247a28e30b810b5452ab4df # Parent 84355e3e4493fb60451ed7d4fe8bc95ffab49f71 hgweb: Make maxfiles, maxchanges, and allowpull proper config options diff -r 84355e3e4493 -r 3f37720e7dc7 doc/hgrc.5.txt --- a/doc/hgrc.5.txt Fri Aug 19 22:11:48 2005 -0800 +++ b/doc/hgrc.5.txt Fri Aug 19 22:12:40 2005 -0800 @@ -114,7 +114,7 @@ ssh;; command to use for SSH connections. Default is 'ssh'. remotecmd;; - command to use for remote push operations. Default is 'hg'. + remote command to use for clone/push/pull operations. Default is 'hg'. web:: @@ -134,6 +134,12 @@ Where to output the error log. Default is stderr. templates;; Where to find the HTML templates. Default is install path. + maxchanges;; + Maximum number of changes to list on the changelog. Default is 10. + maxfiles;; + Maximum number of files to list per changeset. Default is 10. + allowpull;; + Whether to allow pulling from the repository. Default is true. AUTHOR ------ diff -r 84355e3e4493 -r 3f37720e7dc7 mercurial/hgweb.py --- a/mercurial/hgweb.py Fri Aug 19 22:11:48 2005 -0800 +++ b/mercurial/hgweb.py Fri Aug 19 22:12:40 2005 -0800 @@ -127,8 +127,6 @@ } class hgweb: - maxchanges = 10 - maxfiles = 10 def __init__(self, path, name=None, templates=""): self.templates = templates @@ -142,6 +140,9 @@ if s.st_mtime != self.mtime: self.mtime = s.st_mtime self.repo = repository(ui(), self.path) + self.maxchanges = self.repo.ui.config("web", "maxchanges", 10) + self.maxfiles = self.repo.ui.config("web", "maxchanges", 10) + self.allowpull = self.repo.ui.configbool("web", "allowpull", True) def date(self, cs): return time.asctime(time.gmtime(float(cs[2].split(' ')[0]))) @@ -688,7 +689,7 @@ elif args['cmd'][0] == 'changegroup': httphdr("application/mercurial-0.1") nodes = [] - if self.viewonly: + if not self.allowpull: return if args.has_key('roots'):