mirror of
https://github.com/mnauw/git-remote-hg.git
synced 2026-02-27 23:10:41 +01:00
Simplify export_file args
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
This commit is contained in:
@@ -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())))
|
||||
|
||||
Reference in New Issue
Block a user