##// END OF EJS Templates
named branches: client branchmap wire protocol support (issue736)...
Henrik Stuart -
r8563:f8ff65a8 default
parent child Browse files
Show More
@@ -145,6 +145,19 b' class httprepository(repo.repository):'
145 except:
145 except:
146 raise error.ResponseError(_("unexpected response:"), d)
146 raise error.ResponseError(_("unexpected response:"), d)
147
147
148 def branchmap(self):
149 d = self.do_read("branchmap")
150 try:
151 branchmap = {}
152 for branchpart in d.splitlines():
153 branchheads = branchpart.split(' ')
154 branchname = urllib.unquote(branchheads[0])
155 branchheads = [bin(x) for x in branchheads[1:]]
156 branchmap[branchname] = branchheads
157 return branchmap
158 except:
159 raise error.ResponseError(_("unexpected response:"), d)
160
148 def branches(self, nodes):
161 def branches(self, nodes):
149 n = " ".join(map(hex, nodes))
162 n = " ".join(map(hex, nodes))
150 d = self.do_read("branches", nodes=n)
163 d = self.do_read("branches", nodes=n)
@@ -8,7 +8,7 b''
8 from node import bin, hex
8 from node import bin, hex
9 from i18n import _
9 from i18n import _
10 import repo, util, error
10 import repo, util, error
11 import re
11 import re, urllib
12
12
13 class remotelock(object):
13 class remotelock(object):
14 def __init__(self, repo):
14 def __init__(self, repo):
@@ -166,6 +166,19 b' class sshrepository(repo.repository):'
166 except:
166 except:
167 self.abort(error.ResponseError(_("unexpected response:"), d))
167 self.abort(error.ResponseError(_("unexpected response:"), d))
168
168
169 def branchmap(self):
170 d = self.call("branchmap")
171 try:
172 branchmap = {}
173 for branchpart in d.splitlines():
174 branchheads = branchpart.split(' ')
175 branchname = urllib.unquote(branchheads[0])
176 branchheads = [bin(x) for x in branchheads[1:]]
177 branchmap[branchname] = branchheads
178 return branchmap
179 except:
180 raise error.ResponseError(_("unexpected response:"), d)
181
169 def branches(self, nodes):
182 def branches(self, nodes):
170 n = " ".join(map(hex, nodes))
183 n = " ".join(map(hex, nodes))
171 d = self.call("branches", nodes=n)
184 d = self.call("branches", nodes=n)
General Comments 0
You need to be logged in to leave comments. Login now