mercurial/httprepo.py
branchstable
changeset 9878 7e7d56fe4833
parent 9861 0262bb59016f
child 9881 54b518fc6671
child 10263 25e572394f5c
--- a/mercurial/httprepo.py	Tue Nov 17 22:16:41 2009 +0100
+++ b/mercurial/httprepo.py	Wed Nov 18 15:20:08 2009 +0100
@@ -154,10 +154,13 @@
             for branchpart in d.splitlines():
                 branchheads = branchpart.split(' ')
                 branchname = urllib.unquote(branchheads[0])
+                # Earlier servers (1.3.x) send branch names in (their) local
+                # charset. The best we can do is assume it's identical to our
+                # own local charset, in case it's not utf-8.
                 try:
-                    branchname.decode('utf-8', 'strict')
+                    branchname.decode('utf-8')
                 except UnicodeDecodeError:
-                    branchname = encoding.tolocal(branchname)
+                    branchname = encoding.fromlocal(branchname)
                 branchheads = [bin(x) for x in branchheads[1:]]
                 branchmap[branchname] = branchheads
             return branchmap