mirror of
https://github.com/frej/fast-export.git
synced 2026-05-07 19:25:42 +02: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:
15
t/plugins/rename_file_test_plugin/__init__.py
Normal file
15
t/plugins/rename_file_test_plugin/__init__.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import subprocess
|
||||
import shlex
|
||||
import sys
|
||||
from mercurial import node
|
||||
|
||||
def build_filter(args):
|
||||
return Filter(args)
|
||||
|
||||
class Filter:
|
||||
def __init__(self, args):
|
||||
self.filter_contents = shlex.split(args)
|
||||
|
||||
def file_data_filter(self,file_data):
|
||||
if file_data['filename'] == b'b.txt':
|
||||
file_data['filename'] = b'c.txt'
|
||||
Reference in New Issue
Block a user