diff mercurial/commands.py @ 21571:17da326fd041 stable

bookmarks: properly align multi-byte characters
author Matt Mackall <mpm@selenic.com>
date Tue, 27 May 2014 15:16:52 -0700
parents a1381eea7c7d
children 652e07debf10 14560418856d
line wrap: on
line diff
--- a/mercurial/commands.py	Tue May 27 15:13:13 2014 -0700
+++ b/mercurial/commands.py	Tue May 27 15:16:52 2014 -0700
@@ -951,8 +951,9 @@
                 if ui.quiet:
                     ui.write("%s\n" % bmark, label=label)
                 else:
-                    ui.write(" %s %-25s %d:%s\n" % (
-                        prefix, bmark, repo.changelog.rev(n), hexfn(n)),
+                    pad = " " * (25 - encoding.colwidth(bmark))
+                    ui.write(" %s %s%s %d:%s\n" % (
+                        prefix, bmark, pad, repo.changelog.rev(n), hexfn(n)),
                         label=label)
 
 @command('branch',