##// END OF EJS Templates
branchmap: fix defective fallback fix 0262bb59016f...
Sune Foldager -
r9878:7e7d56fe stable
parent child Browse files
Show More
@@ -154,10 +154,13 b' class httprepository(repo.repository):'
154 for branchpart in d.splitlines():
154 for branchpart in d.splitlines():
155 branchheads = branchpart.split(' ')
155 branchheads = branchpart.split(' ')
156 branchname = urllib.unquote(branchheads[0])
156 branchname = urllib.unquote(branchheads[0])
157 # Earlier servers (1.3.x) send branch names in (their) local
158 # charset. The best we can do is assume it's identical to our
159 # own local charset, in case it's not utf-8.
157 try:
160 try:
158 branchname.decode('utf-8', 'strict')
161 branchname.decode('utf-8')
159 except UnicodeDecodeError:
162 except UnicodeDecodeError:
160 branchname = encoding.tolocal(branchname)
163 branchname = encoding.fromlocal(branchname)
161 branchheads = [bin(x) for x in branchheads[1:]]
164 branchheads = [bin(x) for x in branchheads[1:]]
162 branchmap[branchname] = branchheads
165 branchmap[branchname] = branchheads
163 return branchmap
166 return branchmap
@@ -173,10 +173,13 b' class sshrepository(repo.repository):'
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
General Comments 0
You need to be logged in to leave comments. Login now