##// END OF EJS Templates
fastexport: rework newline logic...
Felipe Contreras -
r51219:dd42156b default
parent child Browse files
Show More
@@ -69,10 +69,10 b' def convert_to_git_ref(branch):'
69 return b"refs/heads/" + branch
69 return b"refs/heads/" + branch
70
70
71
71
72 def write_data(buf, data, skip_newline):
72 def write_data(buf, data, add_newline=False):
73 buf.append(b"data %d\n" % len(data))
73 buf.append(b"data %d\n" % len(data))
74 buf.append(data)
74 buf.append(data)
75 if not skip_newline or data[-1:] != b"\n":
75 if add_newline or data[-1:] != b"\n":
76 buf.append(b"\n")
76 buf.append(b"\n")
77
77
78
78
@@ -103,7 +103,7 b' def export_commit(ui, repo, rev, marks, '
103 marks[filerev] = mark
103 marks[filerev] = mark
104 data = filectx.data()
104 data = filectx.data()
105 buf = [b"blob\n", b"mark :%d\n" % mark]
105 buf = [b"blob\n", b"mark :%d\n" % mark]
106 write_data(buf, data, False)
106 write_data(buf, data, True)
107 ui.write(*buf, keepprogressbar=True)
107 ui.write(*buf, keepprogressbar=True)
108 del buf
108 del buf
109
109
@@ -122,7 +122,7 b' def export_commit(ui, repo, rev, marks, '
122 convert_to_git_date(ctx.date()),
122 convert_to_git_date(ctx.date()),
123 ),
123 ),
124 ]
124 ]
125 write_data(buf, ctx.description(), True)
125 write_data(buf, ctx.description())
126 if parents:
126 if parents:
127 buf.append(b"from :%d\n" % marks[parents[0].hex()])
127 buf.append(b"from :%d\n" % marks[parents[0].hex()])
128 if len(parents) == 2:
128 if len(parents) == 2:
General Comments 0
You need to be logged in to leave comments. Login now