Consistently terminate commit messages with LF

When the length logic for fast-import 'data' commands was updated in
4c10270 (Fix data handling, 2023-03-02), one branch was missed, so
commit messages now do not have a final LF appended in most cases. This
changed the longtime behavior, which had been consistent since the first
commit of hg2git, 9832035 (Initial import, 2007-03-06), and is expected
by some applications which compare against old conversions from
Mercurial.
This commit is contained in:
Thalia Archibald
2024-07-05 05:20:35 -07:00
parent 2a3806576c
commit f947189dcc
4 changed files with 77 additions and 52 deletions

View File

@@ -281,7 +281,7 @@ def export_commit(ui,repo,revision,old_marks,max,count,authors,
parents = commit_data['parents']
author = commit_data['author']
user = commit_data['committer']
desc = commit_data['desc'] + b'\n'
desc = commit_data['desc']
if len(parents)==0 and revision != 0:
wr(b'reset refs/heads/%s' % branch)
@@ -291,7 +291,7 @@ def export_commit(ui,repo,revision,old_marks,max,count,authors,
if sob:
wr(b'author %s %d %s' % (author,time,timezone))
wr(b'committer %s %d %s' % (user,time,timezone))
wr_data(desc)
wr_data(desc + b'\n')
man=ctx.manifest()