1 def build_filter(args
):
5 def __init__(self
, args
):
6 args
= {arg
: True for arg
in args
.split(',')}
7 self
.start
= args
.pop('start', False)
8 self
.end
= args
.pop('end', False)
9 self
.sameline
= args
.pop('sameline', False)
10 self
.skip_master
= args
.pop('skipmaster', False)
12 if self
.sameline
and not self
.start
:
13 raise ValueError("sameline option only allowed if 'start' given")
15 raise ValueError("Unknown args: " + ','.join(args
))
17 def commit_message_filter(self
, commit_data
):
18 if not (self
.skip_master
and commit_data
['branch'] == b
'master'):
20 sep
= b
': ' if self
.sameline
else b
'\n'
21 commit_data
['desc'] = commit_data
['branch'] + sep
+ commit_data
['desc']
23 commit_data
['desc'] = (
24 commit_data
['desc'] + b
'\n' + commit_data
['branch']