diff --git a/git-remote-hg b/git-remote-hg index b0cc5b2..e500211 100755 --- a/git-remote-hg +++ b/git-remote-hg @@ -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())))