equal
deleted
inserted
replaced
171 try: |
171 try: |
172 branchmap = {} |
172 branchmap = {} |
173 for branchpart in d.splitlines(): |
173 for branchpart in d.splitlines(): |
174 branchheads = branchpart.split(' ') |
174 branchheads = branchpart.split(' ') |
175 branchname = urllib.unquote(branchheads[0]) |
175 branchname = urllib.unquote(branchheads[0]) |
|
176 # Earlier servers (1.3.x) send branch names in (their) local |
|
177 # charset. The best we can do is assume it's identical to our |
|
178 # own local charset, in case it's not utf-8. |
176 try: |
179 try: |
177 branchname.decode('utf-8', 'strict') |
180 branchname.decode('utf-8') |
178 except UnicodeDecodeError: |
181 except UnicodeDecodeError: |
179 branchname = encoding.tolocal(branchname) |
182 branchname = encoding.fromlocal(branchname) |
180 branchheads = [bin(x) for x in branchheads[1:]] |
183 branchheads = [bin(x) for x in branchheads[1:]] |
181 branchmap[branchname] = branchheads |
184 branchmap[branchname] = branchheads |
182 return branchmap |
185 return branchmap |
183 except: |
186 except: |
184 raise error.ResponseError(_("unexpected response:"), d) |
187 raise error.ResponseError(_("unexpected response:"), d) |