##// END OF EJS Templates
Check protocol versions...
mpm@selenic.com -
r753:8760d0c8 default
parent child Browse files
Show More
@@ -1744,11 +1744,21 b' class httprepository:'
1744 qs = urllib.urlencode(q)
1744 qs = urllib.urlencode(q)
1745 cu = "%s?%s" % (self.url, qs)
1745 cu = "%s?%s" % (self.url, qs)
1746 resp = urllib2.urlopen(cu)
1746 resp = urllib2.urlopen(cu)
1747 proto = resp.headers['content-type']
1747
1748
1748 if not resp.headers['content-type'].startswith('application/hg'):
1749 # accept old "text/plain" and "application/hg-changegroup" for now
1750 if not proto.startswith('application/mercurial') and \
1751 not proto.startswith('text/plain') and \
1752 not proto.startswith('application/hg-changegroup'):
1749 raise RepoError("'%s' does not appear to be an hg repository"
1753 raise RepoError("'%s' does not appear to be an hg repository"
1750 % self.url)
1754 % self.url)
1751
1755
1756 if proto.startswith('application/mercurial'):
1757 version = proto[22:]
1758 if float(version) > 0.1:
1759 raise RepoError("'%s' uses newer protocol %s" %
1760 (self.url, version))
1761
1752 return resp
1762 return resp
1753
1763
1754 def heads(self):
1764 def heads(self):
@@ -670,7 +670,7 b' class hgweb:'
670 sys.stdout.write(" ".join(map(hex, b)) + "\n")
670 sys.stdout.write(" ".join(map(hex, b)) + "\n")
671
671
672 elif args['cmd'][0] == 'between':
672 elif args['cmd'][0] == 'between':
673 httphdr("application/hg-0.1")
673 httphdr("application/mercurial-0.1")
674 nodes = []
674 nodes = []
675 if args.has_key('pairs'):
675 if args.has_key('pairs'):
676 pairs = [ map(bin, p.split("-"))
676 pairs = [ map(bin, p.split("-"))
General Comments 0
You need to be logged in to leave comments. Login now