Simplify export_file args

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
This commit is contained in:
Felipe Contreras
2023-03-20 02:07:45 -06:00
parent 9c5b8835f4
commit 7cff2c6adb

View File

@@ -288,7 +288,8 @@ def fix_file_path(path):
# Git for Windows expects forward
return path.replace(os.sep, '/')
def export_file(f):
def export_file(ctx, fname):
f = ctx.filectx(fname)
fid = node.hex(f.filenode())
if fid in filenodes:
@@ -302,7 +303,7 @@ def export_file(f):
print("mark :%u" % mark)
print_data(d)
path = fix_file_path(f.path())
path = fix_file_path(fname)
return gitmode(f.flags()), mark, path
def get_filechanges(repo, ctx, parents, files):
@@ -523,7 +524,7 @@ def export_ref(repo, name, kind, head):
if len(parents) == 0 and rev:
print('reset %s/%s' % (prefix, ename))
modified_final = [export_file(c.filectx(fname)) for fname in modified]
modified_final = [export_file(c, fname) for fname in modified]
print("commit %s/%s" % (prefix, ename))
print("mark :%d" % (marks.get_mark(c.hex())))