mirror of
https://github.com/frej/fast-export.git
synced 2025-11-03 17:55:49 +01:00
15 lines
521 B
Python
15 lines
521 B
Python
def build_filter(args):
|
|
return Filter(args)
|
|
|
|
class Filter:
|
|
def __init__(self, args):
|
|
if not args in ['start','end']:
|
|
raise Exception('Cannot have branch name anywhere but start and end')
|
|
self.pos = args
|
|
|
|
def commit_message_filter(self,commit_data):
|
|
if self.pos == 'start':
|
|
commit_data['desc'] = commit_data['branch'] + '\n' + commit_data['desc']
|
|
if self.pos == 'end':
|
|
commit_data['desc'] = commit_data['desc'] + '\n' + commit_data['branch']
|