mirror of
https://github.com/frej/fast-export.git
synced 2026-03-18 07:10:13 +01:00
Merge branch 'gh/328'
This commit is contained in:
@@ -6,6 +6,8 @@ class Filter():
|
||||
pass
|
||||
|
||||
def file_data_filter(self,file_data):
|
||||
if file_data['file_ctx'] == None:
|
||||
return
|
||||
file_ctx = file_data['file_ctx']
|
||||
if not file_ctx.isbinary():
|
||||
file_data['data'] = file_data['data'].replace(b'\r\n', b'\n')
|
||||
|
||||
@@ -15,6 +15,8 @@ class Filter:
|
||||
d = file_data['data']
|
||||
file_ctx = file_data['file_ctx']
|
||||
filename = file_data['filename']
|
||||
if file_ctx == None:
|
||||
return
|
||||
filter_cmd = self.filter_contents + [filename, node.hex(file_ctx.filenode()), '1' if file_ctx.isbinary() else '0']
|
||||
try:
|
||||
filter_proc = subprocess.Popen(filter_cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
|
||||
|
||||
@@ -25,7 +25,9 @@ git_convert() {
|
||||
cd "$2" &&
|
||||
hg-fast-export.sh --repo "../$1" \
|
||||
-s --hgtags -n \
|
||||
--plugin ../../plugins/rename_file_test_plugin
|
||||
--plugin ../../plugins/rename_file_test_plugin \
|
||||
--plugin dos2unix \
|
||||
--plugin shell_filter_file_contents=../../plugins/id
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
2
t/plugins/id
Executable file
2
t/plugins/id
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
cat
|
||||
Reference in New Issue
Block a user