Reorganize export_files

No functional changes.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
This commit is contained in:
Felipe Contreras
2023-03-20 01:58:42 -06:00
parent 8025945a62
commit 537e5a4735

View File

@@ -288,25 +288,27 @@ def fix_file_path(path):
# Git for Windows expects forward
return path.replace(os.sep, '/')
def export_file(f):
fid = node.hex(f.filenode())
if fid in filenodes:
mark = filenodes[fid]
else:
mark = marks.next_mark()
filenodes[fid] = mark
d = f.data()
print("blob")
print("mark :%u" % mark)
print_data(d)
path = fix_file_path(f.path())
return gitmode(f.flags()), mark, path
def export_files(files):
final = []
for f in files:
fid = node.hex(f.filenode())
if fid in filenodes:
mark = filenodes[fid]
else:
mark = marks.next_mark()
filenodes[fid] = mark
d = f.data()
print("blob")
print("mark :%u" % mark)
print_data(d)
path = fix_file_path(f.path())
final.append((gitmode(f.flags()), mark, path))
final.append(export_file(f))
return final
def get_filechanges(repo, ctx, parents, files):