mirror of
https://github.com/mnauw/git-remote-hg.git
synced 2025-10-27 14:46:06 +01:00
Merge commit '7908c70efbd0420e21c2b0b7841b61e3b933be51' into felipec
These changes can be merged with limited conflict resolution.
This commit is contained in:
@@ -401,27 +401,24 @@ def fix_file_path(path):
|
|||||||
# even Git for Windows expects forward
|
# even Git for Windows expects forward
|
||||||
return path.replace(compat.to_b(os.sep), b'/')
|
return path.replace(compat.to_b(os.sep), b'/')
|
||||||
|
|
||||||
def export_files(files):
|
def export_file(ctx, fname):
|
||||||
final = []
|
f = ctx.filectx(fname)
|
||||||
for f in files:
|
fid = node.hex(f.filenode())
|
||||||
fid = node.hex(f.filenode())
|
|
||||||
|
|
||||||
if fid in filenodes:
|
if fid in filenodes:
|
||||||
mark = filenodes[fid]
|
mark = filenodes[fid]
|
||||||
else:
|
else:
|
||||||
mark = marks.next_mark()
|
mark = marks.next_mark()
|
||||||
filenodes[fid] = mark
|
filenodes[fid] = mark
|
||||||
d = f.data()
|
d = f.data()
|
||||||
|
|
||||||
puts(b"blob")
|
puts(b"blob")
|
||||||
puts(b"mark :%u" % mark)
|
puts(b"mark :%u" % mark)
|
||||||
puts(b"data %d" % len(d))
|
puts(b"data %d" % len(d))
|
||||||
puts(d)
|
puts(f.data())
|
||||||
|
|
||||||
path = fix_file_path(f.path())
|
path = fix_file_path(f.path())
|
||||||
final.append((gitmode(f.flags()), mark, path))
|
return (gitmode(f.flags()), mark, path)
|
||||||
|
|
||||||
return final
|
|
||||||
|
|
||||||
def get_filechanges(repo, ctx, parent):
|
def get_filechanges(repo, ctx, parent):
|
||||||
if hasattr(parent, 'status'):
|
if hasattr(parent, 'status'):
|
||||||
@@ -715,7 +712,7 @@ def export_ref(repo, name, kind, head):
|
|||||||
if len(parents) == 0:
|
if len(parents) == 0:
|
||||||
puts(b'reset %s/%s' % (prefix, ename))
|
puts(b'reset %s/%s' % (prefix, ename))
|
||||||
|
|
||||||
modified_final = export_files(c.filectx(f) for f in modified)
|
modified_final = [export_file(c, fname) for fname in modified]
|
||||||
|
|
||||||
puts(b"commit %s/%s" % (prefix, ename))
|
puts(b"commit %s/%s" % (prefix, ename))
|
||||||
puts(b"mark :%d" % (marks.get_mark(c.hex())))
|
puts(b"mark :%d" % (marks.get_mark(c.hex())))
|
||||||
|
|||||||
Reference in New Issue
Block a user