mirror of
https://github.com/mnauw/git-remote-hg.git
synced 2026-05-07 02:26:13 +02:00
Reorganize export_files
No functional changes. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user