Mercurial > public > mercurial-scm > hg
comparison mercurial/sshserver.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 | 061eeb602354 |
children | 0c84afa1d622 |
comparison
equal
deleted
inserted
replaced
9712:18b134ef294c | 9713:d193cc97c4e8 |
---|---|
7 # GNU General Public License version 2, incorporated herein by reference. | 7 # GNU General Public License version 2, incorporated herein by reference. |
8 | 8 |
9 from i18n import _ | 9 from i18n import _ |
10 from node import bin, hex | 10 from node import bin, hex |
11 import streamclone, util, hook | 11 import streamclone, util, hook |
12 import os, sys, tempfile, urllib | 12 import os, sys, tempfile, urllib, copy |
13 | 13 |
14 class sshserver(object): | 14 class sshserver(object): |
15 | |
16 caps = 'unbundle lookup changegroupsubset branchmap'.split() | |
17 | |
15 def __init__(self, ui, repo): | 18 def __init__(self, ui, repo): |
16 self.ui = ui | 19 self.ui = ui |
17 self.repo = repo | 20 self.repo = repo |
18 self.lock = None | 21 self.lock = None |
19 self.fin = sys.stdin | 22 self.fin = sys.stdin |
83 Currently the only one defined is "capabilities", which | 86 Currently the only one defined is "capabilities", which |
84 consists of a line in the form: | 87 consists of a line in the form: |
85 | 88 |
86 capabilities: space separated list of tokens | 89 capabilities: space separated list of tokens |
87 ''' | 90 ''' |
88 | 91 caps = copy.copy(self.caps) |
89 caps = ['unbundle', 'lookup', 'changegroupsubset', 'branchmap'] | |
90 if self.ui.configbool('server', 'uncompressed'): | 92 if self.ui.configbool('server', 'uncompressed'): |
91 caps.append('stream=%d' % self.repo.changelog.version) | 93 caps.append('stream=%d' % self.repo.changelog.version) |
92 self.respond("capabilities: %s\n" % (' '.join(caps),)) | 94 self.respond("capabilities: %s\n" % (' '.join(caps),)) |
93 | 95 |
94 def do_lock(self): | 96 def do_lock(self): |