hgext/histedit.py
changeset 24199 4047982904f8
parent 24196 c3d13202144d
child 24231 cc5b46f5318d
--- a/hgext/histedit.py	Tue Mar 03 17:28:05 2015 -0600
+++ b/hgext/histedit.py	Wed Jan 21 14:45:24 2015 -0800
@@ -142,6 +142,13 @@
 as running ``hg histedit 836302820282``. If you need plan to push to a
 repository that Mercurial does not detect to be related to the source
 repo, you can add a ``--force`` option.
+
+Histedit rule lines are truncated to 80 characters by default. You
+can customise this behaviour by setting a different length in your
+configuration file:
+
+[histedit]
+linelen = 120      # truncate rule lines at 120 characters
 """
 
 try:
@@ -843,7 +850,9 @@
         summary = ctx.description().splitlines()[0]
     line = '%s %s %d %s' % (action, ctx, ctx.rev(), summary)
     # trim to 80 columns so it's not stupidly wide in my editor
-    return util.ellipsis(line, 80)
+    maxlen = repo.ui.configint('histedit', 'linelen', default=80)
+    maxlen = max(maxlen, 22) # avoid truncating hash
+    return util.ellipsis(line, maxlen)
 
 def ruleeditor(repo, ui, rules, editcomment=""):
     """open an editor to edit rules