diff mercurial/archival.py @ 13047:6c375e07d673

branch: operate on branch names in local string space where possible Previously, branch names were ideally manipulated as UTF-8 strings, because they were stored as UTF-8 in the dirstate and the changelog and could not be safely converted to the local encoding and back. However, only about 80% of branch name code was actually using the right encoding conventions. This patch uses the localstr addition to allow working on branch names as local strings, which simplifies handling so that the previously incorrect code becomes correct.
author Matt Mackall <mpm@selenic.com>
date Wed, 24 Nov 2010 15:56:32 -0600
parents f00953d9533c
children 5dac0d04b838
line wrap: on
line diff
--- a/mercurial/archival.py	Wed Nov 24 15:38:52 2010 -0600
+++ b/mercurial/archival.py	Wed Nov 24 15:56:32 2010 -0600
@@ -8,7 +8,7 @@
 from i18n import _
 from node import hex
 import cmdutil
-import util
+import util, encoding
 import cStringIO, os, stat, tarfile, time, zipfile
 import zlib, gzip
 
@@ -243,7 +243,7 @@
     if repo.ui.configbool("ui", "archivemeta", True):
         def metadata():
             base = 'repo: %s\nnode: %s\nbranch: %s\n' % (
-                repo[0].hex(), hex(node), ctx.branch())
+                repo[0].hex(), hex(node), encoding.fromlocal(ctx.branch()))
 
             tags = ''.join('tag: %s\n' % t for t in ctx.tags()
                            if repo.tagtype(t) == 'global')