comparison mercurial/statichttprepo.py @ 3044:fcadf7a32425

Merge with mpm
author Josef "Jeff" Sipek <jeffpc@josefsipek.net>
date Sun, 03 Sep 2006 06:06:02 -0400
parents 345bac2bc4ec
children ff06fe0703ef
comparison
equal deleted inserted replaced
3043:2a4d4aecb2b4 3044:fcadf7a32425
1 # statichttprepo.py - simple http repository class for mercurial 1 # statichttprepo.py - simple http repository class for mercurial
2 # 2 #
3 # This provides read-only repo access to repositories exported via static http 3 # This provides read-only repo access to repositories exported via static http
4 # 4 #
5 # Copyright 2005 Matt Mackall <mpm@selenic.com> 5 # Copyright 2005, 2006 Matt Mackall <mpm@selenic.com>
6 # 6 #
7 # This software may be used and distributed according to the terms 7 # This software may be used and distributed according to the terms
8 # of the GNU General Public License, incorporated herein by reference. 8 # of the GNU General Public License, incorporated herein by reference.
9 9
10 from demandload import demandload 10 from demandload import *
11 from i18n import gettext as _
11 demandload(globals(), "changelog filelog httprangereader") 12 demandload(globals(), "changelog filelog httprangereader")
12 demandload(globals(), "localrepo manifest os urllib urllib2") 13 demandload(globals(), "localrepo manifest os urllib urllib2 util")
13 14
14 class rangereader(httprangereader.httprangereader): 15 class rangereader(httprangereader.httprangereader):
15 def read(self, size=None): 16 def read(self, size=None):
16 try: 17 try:
17 return httprangereader.httprangereader.read(self, size) 18 return httprangereader.httprangereader.read(self, size)
48 def dev(self): 49 def dev(self):
49 return -1 50 return -1
50 51
51 def local(self): 52 def local(self):
52 return False 53 return False
54
55 def instance(ui, path, create):
56 if create:
57 raise util.Abort(_('cannot create new static-http repository'))
58 if path.startswith('old-http:'):
59 ui.warn(_("old-http:// syntax is deprecated, "
60 "please use static-http:// instead\n"))
61 path = path[4:]
62 else:
63 path = path[7:]
64 return statichttprepository(ui, path)