diff hgext/histedit.py @ 21858:50fd3a36d166

histedit: use 'util.ellipsis' to trim description of each changesets Before this patch, trimming description of each changesets in histedit may split at intermediate multi-byte sequence. This patch uses 'util.ellipsis' to trim description of each changesets instead of directly slicing byte sequence. Even though 'util.ellipsis' adds '...' as ellipsis when specified string is trimmed (= this changes result of trimming), this patch uses it, because: - it can be used without any additional 'import', and - ellipsis seems to be better than just trimming, for usability
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Sun, 06 Jul 2014 02:56:41 +0900
parents 503bb3af70fe
children af44c7a1e55e
line wrap: on
line diff
--- a/hgext/histedit.py	Sun Jul 06 02:56:41 2014 +0900
+++ b/hgext/histedit.py	Sun Jul 06 02:56:41 2014 +0900
@@ -760,7 +760,8 @@
     if c.description():
         summary = c.description().splitlines()[0]
     line = 'pick %s %d %s' % (c, c.rev(), summary)
-    return line[:80]  # trim to 80 chars so it's not stupidly wide in my editor
+    # trim to 80 columns so it's not stupidly wide in my editor
+    return util.ellipsis(line, 80)
 
 def verifyrules(rules, repo, ctxs):
     """Verify that there exists exactly one edit rule per given changeset.