changeset 34472:12c068377273

configitems: register the 'histedit.linelen' config
author Boris Feld <boris.feld@octobus.net>
date Fri, 30 Jun 2017 03:42:39 +0200
parents 1e37cb4da6f8
children a746472c3d09
files hgext/histedit.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/histedit.py	Fri Jun 30 03:42:38 2017 +0200
+++ b/hgext/histedit.py	Fri Jun 30 03:42:39 2017 +0200
@@ -221,6 +221,9 @@
 configitem('histedit', 'dropmissing',
     default=False,
 )
+configitem('histedit', 'linelen',
+    default=80,
+)
 
 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
@@ -452,7 +455,7 @@
         line = '%s %s %d %s' % (self.verb, ctx, ctx.rev(), summary)
         # trim to 75 columns by default so it's not stupidly wide in my editor
         # (the 5 more are left for verb)
-        maxlen = self.repo.ui.configint('histedit', 'linelen', default=80)
+        maxlen = self.repo.ui.configint('histedit', 'linelen')
         maxlen = max(maxlen, 22) # avoid truncating hash
         return util.ellipsis(line, maxlen)