# HG changeset patch # User Alexis S. L. Carvalho # Date 1165549010 7200 # Node ID 3674ca805a5bf854d74f7029ee027299e6f50afd # Parent b3b868113d245bcbc21adcea4b5a0c9787049f15 log: convert branch names to the local encoding diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -261,6 +261,7 @@ class changeset_printer(object): self.ui.write(_("changeset: %d:%s\n") % (rev, hexfunc(changenode))) if branch: + branch = util.tolocal(branch) self.ui.write(_("branch: %s\n") % branch) for tag in self.repo.nodetags(changenode): self.ui.write(_("tag: %s\n") % tag) @@ -404,6 +405,7 @@ class changeset_templater(changeset_prin def showbranches(**args): branch = changes[5].get("branch") if branch: + branch = util.tolocal(branch) return showlist('branch', [branch], plural='branches', **args) # add old style branches if requested if self.brinfo: diff --git a/tests/test-encoding b/tests/test-encoding --- a/tests/test-encoding +++ b/tests/test-encoding @@ -25,6 +25,9 @@ echo "utf-8" > a HGENCODING=utf-8 hg ci -l utf-8 -d "0 0" HGENCODING=latin-1 hg tag -d "0 0" `cat latin-1-tag` +cp latin-1-tag .hg/branch +HGENCODING=latin-1 hg ci -d "0 0" -m 'latin1 branch' +rm .hg/branch echo % ascii hg --encoding ascii log @@ -38,3 +41,9 @@ echo % latin-1 HGENCODING=latin-1 hg tags echo % utf-8 HGENCODING=utf-8 hg tags +echo % ascii +HGENCODING=ascii hg branches +echo % latin-1 +HGENCODING=latin-1 hg branches +echo % utf-8 +HGENCODING=utf-8 hg branches diff --git a/tests/test-encoding.out b/tests/test-encoding.out --- a/tests/test-encoding.out +++ b/tests/test-encoding.out @@ -15,8 +15,14 @@ transaction abort! rollback completed % these should work % ascii +changeset: 4:d8a5d9eaf41e +branch: ? +tag: tip +user: test +date: Thu Jan 01 00:00:00 1970 +0000 +summary: latin1 branch + changeset: 3:5edfc7acb541 -tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: Added tag ? for changeset 91878608adb3 @@ -38,8 +44,14 @@ date: Thu Jan 01 00:00:00 1970 +0 summary: latin-1 e': ? % latin-1 +changeset: 4:d8a5d9eaf41e +branch: é +tag: tip +user: test +date: Thu Jan 01 00:00:00 1970 +0000 +summary: latin1 branch + changeset: 3:5edfc7acb541 -tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: Added tag é for changeset 91878608adb3 @@ -61,8 +73,14 @@ date: Thu Jan 01 00:00:00 1970 +0 summary: latin-1 e': é % utf-8 +changeset: 4:d8a5d9eaf41e +branch: é +tag: tip +user: test +date: Thu Jan 01 00:00:00 1970 +0000 +summary: latin1 branch + changeset: 3:5edfc7acb541 -tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: Added tag é for changeset 91878608adb3 @@ -84,11 +102,17 @@ date: Thu Jan 01 00:00:00 1970 +0 summary: latin-1 e': é % ascii -tip 3:5edfc7acb541 +tip 4:d8a5d9eaf41e ? 2:91878608adb3 % latin-1 -tip 3:5edfc7acb541 +tip 4:d8a5d9eaf41e é 2:91878608adb3 % utf-8 -tip 3:5edfc7acb541 +tip 4:d8a5d9eaf41e é 2:91878608adb3 +% ascii +? 4:d8a5d9eaf41e +% latin-1 +é 4:d8a5d9eaf41e +% utf-8 +é 4:d8a5d9eaf41e