##// END OF EJS Templates
Use UTF-8 in .hg/branch
Alexis S. L. Carvalho -
r3862:46abbed0 default
parent child Browse files
Show More
@@ -256,9 +256,9 b' def branch(ui, repo, label=None):'
256 """
256 """
257
257
258 if label is not None:
258 if label is not None:
259 repo.opener("branch", "w").write(label)
259 repo.opener("branch", "w").write(util.fromlocal(label) + '\n')
260 else:
260 else:
261 b = repo.workingctx().branch()
261 b = util.tolocal(repo.workingctx().branch())
262 if b:
262 if b:
263 ui.write("%s\n" % b)
263 ui.write("%s\n" % b)
264
264
@@ -1433,7 +1433,7 b' def identify(ui, repo):'
1433
1433
1434 if not ui.quiet:
1434 if not ui.quiet:
1435
1435
1436 branch = repo.workingctx().branch()
1436 branch = util.tolocal(repo.workingctx().branch())
1437 if branch:
1437 if branch:
1438 output.append("(%s)" % branch)
1438 output.append("(%s)" % branch)
1439
1439
@@ -683,7 +683,11 b' class localrepository(repo.repository):'
683 m2 = self.manifest.read(c2[0])
683 m2 = self.manifest.read(c2[0])
684
684
685 if use_dirstate:
685 if use_dirstate:
686 branchname = util.fromlocal(self.workingctx().branch())
686 branchname = self.workingctx().branch()
687 try:
688 branchname = branchname.decode('UTF-8').encode('UTF-8')
689 except UnicodeDecodeError:
690 raise util.Abort(_('branch name not in UTF-8!'))
687 else:
691 else:
688 branchname = ""
692 branchname = ""
689
693
@@ -489,7 +489,6 b' def update(repo, node, branchmerge, forc'
489 repo.dirstate.setparents(fp1, fp2)
489 repo.dirstate.setparents(fp1, fp2)
490 repo.hook('update', parent1=xp1, parent2=xp2, error=stats[3])
490 repo.hook('update', parent1=xp1, parent2=xp2, error=stats[3])
491 if not branchmerge:
491 if not branchmerge:
492 b = util.tolocal(p2.branch())
493 repo.opener("branch", "w").write(p2.branch() + "\n")
492 repo.opener("branch", "w").write(p2.branch() + "\n")
494
493
495 return stats
494 return stats
@@ -25,7 +25,7 b' echo "utf-8" > a'
25 HGENCODING=utf-8 hg ci -l utf-8 -d "1000000 0"
25 HGENCODING=utf-8 hg ci -l utf-8 -d "1000000 0"
26
26
27 HGENCODING=latin-1 hg tag -d "1000000 0" `cat latin-1-tag`
27 HGENCODING=latin-1 hg tag -d "1000000 0" `cat latin-1-tag`
28 cp latin-1-tag .hg/branch
28 HGENCODING=latin-1 hg branch `cat latin-1-tag`
29 HGENCODING=latin-1 hg ci -d "1000000 0" -m 'latin1 branch'
29 HGENCODING=latin-1 hg ci -d "1000000 0" -m 'latin1 branch'
30 rm .hg/branch
30 rm .hg/branch
31
31
@@ -55,4 +55,7 b' HGENCODING=utf-8 hg log'
55
55
56 HGENCODING=dolphin hg log
56 HGENCODING=dolphin hg log
57
57
58 HGENCODING=ascii hg branch `cat latin-1-tag`
59 cp latin-1-tag .hg/branch
60 HGENCODING=latin-1 hg ci -d "1000000 0" -m 'should fail'
58 exit 0
61 exit 0
@@ -165,3 +165,5 b' date: Mon Jan 12 13:46:40 1970 +0'
165 summary: latin-1 e': И = u'\xe9'
165 summary: latin-1 e': И = u'\xe9'
166
166
167 abort: unknown encoding: dolphin, please check your locale settings
167 abort: unknown encoding: dolphin, please check your locale settings
168 abort: decoding near '�': 'ascii' codec can't decode byte 0xe9 in position 0: ordinal not in range(128)!
169 abort: branch name not in UTF-8!
General Comments 0
You need to be logged in to leave comments. Login now