[Python-checkins] hooks: Restrict number of lines in log message.

local-hg python-checkins at python.org
Tue Oct 9 21:47:55 CEST 2012


http://hg.python.org/hooks/rev/fc6022656a7b
changeset:   87:fc6022656a7b
user:        hg repo admin <python-dev at python.org>
date:        Tue Oct 09 19:47:53 2012 +0000
summary:
  Restrict number of lines in log message.

files:
  hgirker.py |  5 ++++-
  1 files changed, 4 insertions(+), 1 deletions(-)


diff --git a/hgirker.py b/hgirker.py
--- a/hgirker.py
+++ b/hgirker.py
@@ -54,7 +54,10 @@
     d['branch'] = ctx.branch()
     d['author'] = person(ctx.user())
     d['rev'] = '%d:%s' % (ctx.rev(), ns)
-    d['logmsg'] = ctx.description()
+    logmsg = filter(None, ctx.description().splitlines())
+    d['logmsg'] = ' '.join(logmsg[:4])
+    if len(logmsg) > 4:
+        d['logmsg'] += '...'
     if env['baseurl']:
         d['url'] = env['baseurl'].rstrip('/') + '/rev/%s' % ns
     else:

-- 
Repository URL: http://hg.python.org/hooks


More information about the Python-checkins mailing list