mirror of
https://github.com/frej/fast-export.git
synced 2025-11-03 01:35:48 +01:00
Run file_data_filter on deleted files
The `file_data_filter` method should be called when files are deleted. In this case the `data` and `file_ctx` keys map to None. This is so that a filter which modifies file names can apply the same name transformations before files are deleted.
This commit is contained in:
@@ -311,9 +311,18 @@ def export_commit(ui,repo,revision,old_marks,max,count,authors,
|
||||
% (branch, type.encode(), revision + 1, max, len(modified), len(removed))
|
||||
)
|
||||
|
||||
for filename in removed:
|
||||
for file in removed:
|
||||
if fn_encoding:
|
||||
filename=filename.decode(fn_encoding).encode('utf8')
|
||||
filename=file.decode(fn_encoding).encode('utf8')
|
||||
else:
|
||||
filename=file
|
||||
|
||||
if plugins and plugins['file_data_filters']:
|
||||
file_data = {'filename':filename, 'file_ctx':None, 'data':None}
|
||||
for filter in plugins['file_data_filters']:
|
||||
filter(file_data)
|
||||
filename=file_data['filename']
|
||||
|
||||
filename=strip_leading_slash(filename)
|
||||
if filename==b'.hgsub':
|
||||
remove_gitmodules(ctx)
|
||||
|
||||
Reference in New Issue
Block a user