diff mercurial/hgweb/protocol.py @ 9713:d193cc97c4e8

hgweb/sshserver: extract capabilities for easier modification
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Thu, 05 Nov 2009 11:07:01 +0100
parents 8269fe2d48f6
children 25e572394f5c
line wrap: on
line diff
--- a/mercurial/hgweb/protocol.py	Thu Nov 05 10:44:36 2009 +0100
+++ b/mercurial/hgweb/protocol.py	Thu Nov 05 11:07:01 2009 +0100
@@ -5,7 +5,7 @@
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2, incorporated herein by reference.
 
-import cStringIO, zlib, tempfile, errno, os, sys, urllib
+import cStringIO, zlib, tempfile, errno, os, sys, urllib, copy
 from mercurial import util, streamclone
 from mercurial.node import bin, hex
 from mercurial import changegroup as changegroupmod
@@ -21,6 +21,7 @@
 ]
 
 HGTYPE = 'application/mercurial-0.1'
+basecaps = 'lookup changegroupsubset branchmap'.split()
 
 def lookup(repo, req):
     try:
@@ -109,7 +110,7 @@
     yield z.flush()
 
 def capabilities(repo, req):
-    caps = ['lookup', 'changegroupsubset', 'branchmap']
+    caps = copy.copy(basecaps)
     if repo.ui.configbool('server', 'uncompressed', untrusted=True):
         caps.append('stream=%d' % repo.changelog.version)
     if changegroupmod.bundlepriority: