From 0b923f7cebcdb0f9435c0961a08c537fad7608e0 Mon Sep 17 00:00:00 2001 From: Bogdano Arendartchuk Date: Thu, 8 Nov 2007 16:30:08 +0000 Subject: Added the complement to SILENT: CLOG When using CLOG, only those lines beginning with this token will be shown. It only works when enabled in repsys.conf. --- RepSys/log.py | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'RepSys/log.py') diff --git a/RepSys/log.py b/RepSys/log.py index 009e4e0..10026c3 100644 --- a/RepSys/log.py +++ b/RepSys/log.py @@ -246,13 +246,25 @@ def parse_raw_date(rawdate): return time.strftime("%a %b %d %Y", rawdate) def filter_log_lines(lines): - # lines in commit messages containing SILENT at any position will be - # skipped; commits with their log messages beggining with SILENT in the - # first positionj of the first line will have all lines ignored. - ignstr = config.get("log", "ignore-string", "SILENT") - if len(lines) and lines[0].startswith(ignstr): - return [] - filtered = [line for line in lines if ignstr not in line] + # Lines in commit messages beginning with CLOG will be the only shown + # in the changelog. These lines will have the CLOG token and blanks + # stripped from the beginning. + onlylines = None + clogstr = config.get("log", "unignore-string") + if clogstr: + clogre = re.compile(r"(^%s[^ \t]?[ \t])" % clogstr) + onlylines = [clogre.sub("", line) + for line in lines if line.startswith(clogstr)] + if onlylines: + filtered = onlylines + else: + # Lines in commit messages containing SILENT at any position will be + # skipped; commits with their log messages beggining with SILENT in the + # first positionj of the first line will have all lines ignored. + ignstr = config.get("log", "ignore-string", "SILENT") + if len(lines) and lines[0].startswith(ignstr): + return [] + filtered = [line for line in lines if ignstr not in line] return filtered -- cgit v1.2.1