diff options
author | Bogdano Arendartchuk <bogdano@mandriva.org> | 2007-01-02 19:30:29 +0000 |
---|---|---|
committer | Bogdano Arendartchuk <bogdano@mandriva.org> | 2007-01-02 19:30:29 +0000 |
commit | ae858677cdae9a7fa093fda779661d3d26b6b4c6 (patch) | |
tree | 836e7a55888f8096b66a8c5971b0bc28fa7d1623 | |
parent | c2361c74e06a0fe7e84b534a74f868cf19f90f5a (diff) | |
download | mgarepo-ae858677cdae9a7fa093fda779661d3d26b6b4c6.tar mgarepo-ae858677cdae9a7fa093fda779661d3d26b6b4c6.tar.gz mgarepo-ae858677cdae9a7fa093fda779661d3d26b6b4c6.tar.bz2 mgarepo-ae858677cdae9a7fa093fda779661d3d26b6b4c6.tar.xz mgarepo-ae858677cdae9a7fa093fda779661d3d26b6b4c6.zip |
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.
-rw-r--r-- | RepSys/log.py | 19 |
1 files 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 |