changeset 4143:26314500a5e1

Don't truncate tag and branch names after 30 chars (introduced 73860ffbe798) with test added for a long (local) tag name.
author Thomas Arendsen Hein <thomas@intevation.de>
date Mon, 05 Mar 2007 19:48:21 +0100
parents ba3e13306f70
children 03e9c22a6489 30857b5779f8
files mercurial/commands.py tests/test-tags tests/test-tags.out
diffstat 3 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Sun Mar 04 18:42:31 2007 +0100
+++ b/mercurial/commands.py	Mon Mar 05 19:48:21 2007 +0100
@@ -275,9 +275,8 @@
         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 @@
         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
--- a/tests/test-tags	Sun Mar 04 18:42:31 2007 +0100
+++ b/tests/test-tags	Mon Mar 05 19:48:21 2007 +0100
@@ -10,6 +10,9 @@
 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
--- a/tests/test-tags.out	Sun Mar 04 18:42:31 2007 +0100
+++ b/tests/test-tags.out	Mon Mar 05 19:48:21 2007 +0100
@@ -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