diff mercurial/commands.py @ 3862:46abbed02b2d

Use UTF-8 in .hg/branch
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Sun, 10 Dec 2006 20:35:28 -0200
parents 8c24b6fd5866
children 6081b4c68baf 1e0b94cfba0e
line wrap: on
line diff
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -256,9 +256,9 @@ def branch(ui, repo, label=None):
     """
 
     if label is not None:
-        repo.opener("branch", "w").write(label)
+        repo.opener("branch", "w").write(util.fromlocal(label) + '\n')
     else:
-        b = repo.workingctx().branch()
+        b = util.tolocal(repo.workingctx().branch())
         if b:
             ui.write("%s\n" % b)
 
@@ -1433,7 +1433,7 @@ def identify(ui, repo):
 
     if not ui.quiet:
 
-        branch = repo.workingctx().branch()
+        branch = util.tolocal(repo.workingctx().branch())
         if branch:
             output.append("(%s)" % branch)