Show More
@@ -5,9 +5,10 b'' | |||
|
5 | 5 | # This software may be used and distributed according to the terms |
|
6 | 6 | # of the GNU General Public License, incorporated herein by reference. |
|
7 | 7 | |
|
8 | import urllib, urllib2, urlparse, os, zlib | |
|
9 | 8 | from node import * |
|
10 | 9 | from remoterepo import * |
|
10 | from demandload import * | |
|
11 | demandload(globals(), "hg os urllib urllib2 urlparse zlib") | |
|
11 | 12 | |
|
12 | 13 | class httprepository(remoterepository): |
|
13 | 14 | def __init__(self, ui, path): |
@@ -76,14 +77,14 b' class httprepository(remoterepository):' | |||
|
76 | 77 | if not proto.startswith('application/mercurial') and \ |
|
77 | 78 | not proto.startswith('text/plain') and \ |
|
78 | 79 | not proto.startswith('application/hg-changegroup'): |
|
79 | raise RepoError("'%s' does not appear to be an hg repository" | |
|
80 |
|
|
|
80 | raise hg.RepoError("'%s' does not appear to be an hg repository" % | |
|
81 | self.url) | |
|
81 | 82 | |
|
82 | 83 | if proto.startswith('application/mercurial'): |
|
83 | 84 | version = proto[22:] |
|
84 | 85 | if float(version) > 0.1: |
|
85 | raise RepoError("'%s' uses newer protocol %s" % | |
|
86 | (self.url, version)) | |
|
86 | raise hg.RepoError("'%s' uses newer protocol %s" % | |
|
87 | (self.url, version)) | |
|
87 | 88 | |
|
88 | 89 | return resp |
|
89 | 90 |
@@ -5,9 +5,10 b'' | |||
|
5 | 5 | # This software may be used and distributed according to the terms |
|
6 | 6 | # of the GNU General Public License, incorporated herein by reference. |
|
7 | 7 | |
|
8 | import os, re, select | |
|
9 | 8 | from node import * |
|
10 | 9 | from remoterepo import * |
|
10 | from demandload import * | |
|
11 | demandload(globals(), "hg os re select") | |
|
11 | 12 | |
|
12 | 13 | class sshrepository(remoterepository): |
|
13 | 14 | def __init__(self, ui, path): |
@@ -16,7 +17,7 b' class sshrepository(remoterepository):' | |||
|
16 | 17 | |
|
17 | 18 | m = re.match(r'ssh://(([^@]+)@)?([^:/]+)(:(\d+))?(/(.*))?', path) |
|
18 | 19 | if not m: |
|
19 | raise RepoError("couldn't parse destination %s" % path) | |
|
20 | raise hg.RepoError("couldn't parse destination %s" % path) | |
|
20 | 21 | |
|
21 | 22 | self.user = m.group(2) |
|
22 | 23 | self.host = m.group(3) |
@@ -71,7 +72,7 b' class sshrepository(remoterepository):' | |||
|
71 | 72 | try: |
|
72 | 73 | l = int(l) |
|
73 | 74 | except: |
|
74 | raise RepoError("unexpected response '%s'" % l) | |
|
75 | raise hg.RepoError("unexpected response '%s'" % l) | |
|
75 | 76 | return r.read(l) |
|
76 | 77 | |
|
77 | 78 | def lock(self): |
@@ -86,7 +87,7 b' class sshrepository(remoterepository):' | |||
|
86 | 87 | try: |
|
87 | 88 | return map(bin, d[:-1].split(" ")) |
|
88 | 89 | except: |
|
89 | raise RepoError("unexpected response '%s'" % (d[:400] + "...")) | |
|
90 | raise hg.RepoError("unexpected response '%s'" % (d[:400] + "...")) | |
|
90 | 91 | |
|
91 | 92 | def branches(self, nodes): |
|
92 | 93 | n = " ".join(map(hex, nodes)) |
@@ -95,7 +96,7 b' class sshrepository(remoterepository):' | |||
|
95 | 96 | br = [ tuple(map(bin, b.split(" "))) for b in d.splitlines() ] |
|
96 | 97 | return br |
|
97 | 98 | except: |
|
98 | raise RepoError("unexpected response '%s'" % (d[:400] + "...")) | |
|
99 | raise hg.RepoError("unexpected response '%s'" % (d[:400] + "...")) | |
|
99 | 100 | |
|
100 | 101 | def between(self, pairs): |
|
101 | 102 | n = "\n".join(["-".join(map(hex, p)) for p in pairs]) |
@@ -104,7 +105,7 b' class sshrepository(remoterepository):' | |||
|
104 | 105 | p = [ l and map(bin, l.split(" ")) or [] for l in d.splitlines() ] |
|
105 | 106 | return p |
|
106 | 107 | except: |
|
107 | raise RepoError("unexpected response '%s'" % (d[:400] + "...")) | |
|
108 | raise hg.RepoError("unexpected response '%s'" % (d[:400] + "...")) | |
|
108 | 109 | |
|
109 | 110 | def changegroup(self, nodes): |
|
110 | 111 | n = " ".join(map(hex, nodes)) |
@@ -114,7 +115,7 b' class sshrepository(remoterepository):' | |||
|
114 | 115 | def addchangegroup(self, cg): |
|
115 | 116 | d = self.call("addchangegroup") |
|
116 | 117 | if d: |
|
117 | raise RepoError("push refused: %s", d) | |
|
118 | raise hg.RepoError("push refused: %s", d) | |
|
118 | 119 | |
|
119 | 120 | while 1: |
|
120 | 121 | d = cg.read(4096) |
General Comments 0
You need to be logged in to leave comments.
Login now