comparison mercurial/repo.py @ 2612:ffb895f16925

add support for streaming clone. existing clone code uses pull to get changes from remote repo. is very slow, uses lots of memory and cpu. new clone code has server write file data straight to client, client writes file data straight to disk. memory and cpu used are very low, clone is much faster over lan. new client can still clone with pull, can still clone from older servers. new server can still serve older clients.
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Fri, 14 Jul 2006 11:17:22 -0700
parents 142b5d5ec9cc
children 345bac2bc4ec
comparison
equal deleted inserted replaced
2611:1b4eb1f92433 2612:ffb895f16925
3 # Copyright 2005 Matt Mackall <mpm@selenic.com> 3 # Copyright 2005 Matt Mackall <mpm@selenic.com>
4 # 4 #
5 # This software may be used and distributed according to the terms 5 # This software may be used and distributed according to the terms
6 # of the GNU General Public License, incorporated herein by reference. 6 # of the GNU General Public License, incorporated herein by reference.
7 7
8 class RepoError(Exception): pass 8 class RepoError(Exception):
9 pass
10
11 class repository(object):
12 def capable(self, name):
13 '''tell whether repo supports named capability.
14 return False if not supported.
15 if boolean capability, return True.
16 if string capability, return string.'''
17 name_eq = name + '='
18 for cap in self.capabilities:
19 if name == cap:
20 return True
21 if cap.startswith(name_eq):
22 return cap[len(name_eq):]
23 return False