# HG changeset patch # User Thomas Arendsen Hein # Date 1173120501 -3600 # Node ID 26314500a5e10ada4d892eef040541e310759a56 # Parent ba3e13306f70344653f08ebac32c04b004f00d4b Don't truncate tag and branch names after 30 chars (introduced 73860ffbe798) with test added for a long (local) tag name. diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -275,9 +275,8 @@ def branches(ui, repo): if ui.quiet: ui.write("%s\n" % t) else: - t = util.localsub(t, 30) - t += " " * (30 - util.locallen(t)) - ui.write("%s %s:%s\n" % (t, -r, hexfunc(n))) + spaces = " " * (30 - util.locallen(t)) + ui.write("%s%s %s:%s\n" % (t, spaces, -r, hexfunc(n))) def bundle(ui, repo, fname, dest=None, **opts): """create a changegroup file @@ -2474,9 +2473,8 @@ def tags(ui, repo): if ui.quiet: ui.write("%s\n" % t) else: - t = util.localsub(t, 30) - t += " " * (30 - util.locallen(t)) - ui.write("%s %s\n" % (t, r)) + spaces = " " * (30 - util.locallen(t)) + ui.write("%s%s %s\n" % (t, spaces, r)) def tip(ui, repo, **opts): """show the tip revision diff --git a/tests/test-tags b/tests/test-tags --- a/tests/test-tags +++ b/tests/test-tags @@ -10,6 +10,9 @@ hg commit -m "test" -d "1000000 0" hg co hg identify T=`hg tip --debug | head -n 1 | cut -d : -f 3` +hg tag -l "This is a local tag with a really long name!" +hg tags +rm .hg/localtags echo "$T first" > .hgtags cat .hgtags hg add .hgtags diff --git a/tests/test-tags.out b/tests/test-tags.out --- a/tests/test-tags.out +++ b/tests/test-tags.out @@ -1,6 +1,8 @@ unknown 0 files updated, 0 files merged, 0 files removed, 0 files unresolved 0acdaf898367 tip +tip 0:0acdaf898367 +This is a local tag with a really long name! 0:0acdaf898367 0acdaf8983679e0aac16e811534eb49d7ee1f2b4 first tip 1:8a3ca90d111d first 0:0acdaf898367