From ae858677cdae9a7fa093fda779661d3d26b6b4c6 Mon Sep 17 00:00:00 2001 From: Bogdano Arendartchuk Date: Tue, 2 Jan 2007 19:30:29 +0000 Subject: Changed the behavior of the SILENT option to be line-oriented. Lines in the commit messages containing SILENT at any place will be ignored. Commit messages containing SILENT at the beginning of the first line will make all lines to be ignored. --- RepSys/log.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/RepSys/log.py b/RepSys/log.py index 064b585..f3f2bab 100644 --- a/RepSys/log.py +++ b/RepSys/log.py @@ -195,12 +195,16 @@ def get_author_name(author): def parse_raw_date(rawdate): return time.strftime("%a %b %d %Y", rawdate) -def ignore_log_entry(entry): +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 be completely ignored. ignstr = config.get("log", "ignore-string", "SILENT") - for line in entry.lines: - if ignstr in line: - return True - return False + if len(lines) and lines[0].startswith(ignstr): + return None + filtered = [line for line in lines if ignstr not in line] + return filtered + def make_release(author=None, revision=None, date=None, lines=None, entries=[], released=True, version=None, release=None): @@ -215,11 +219,12 @@ def make_release(author=None, revision=None, date=None, lines=None, rel.lines = lines rel.released = released for entry in entries: - if ignore_log_entry(entry): + lines = filter_log_lines(entry.lines) + if lines is None: continue revision = _Revision() revision.revision = entry.revision - revision.lines = format_lines(entry.lines) + revision.lines = format_lines(lines) revision.date = parse_raw_date(entry.date) revision.raw_date = entry.date revision.author = entry.author -- cgit v1.2.1