Patchwork [3,of,6] configitems: register the 'histedit.linelen' config

login
register
mail settings
Submitter Boris Feld
Date Oct. 4, 2017, 1:54 p.m.
Message ID <09fb4c4519ebf7419740.1507125248@FB>
Download mbox | patch
Permalink /patch/24476/
State Accepted
Headers show

Comments

Boris Feld - Oct. 4, 2017, 1:54 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1498786959 -7200
#      Fri Jun 30 03:42:39 2017 +0200
# Node ID 09fb4c4519ebf7419740ec823b0141f4e26dae6a
# Parent  04e7d86073c7db82a1d626c1bdeb6b40a5df9722
# EXP-Topic config.register.histedit
configitems: register the 'histedit.linelen' config

Patch

diff -r 04e7d86073c7 -r 09fb4c4519eb hgext/histedit.py
--- 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)