Fix data handling
commit4c10270302979f76d3bf143a2c3b3374c1b36e2c
authorFelipe Contreras <felipe.contreras@gmail.com>
Thu, 2 Mar 2023 20:26:24 +0000 (2 14:26 -0600)
committerFelipe Contreras <felipe.contreras@gmail.com>
Sat, 4 Mar 2023 01:33:45 +0000 (3 19:33 -0600)
tree7844d96fcd553f9a480a627401166629c30f9b22
parent723d8032ba69594f86e282cc3b0f31cbe19f19f8
Fix data handling

The length should be exactly the same as the data, for example if the
data is "hello" only 5 characters should be written on the stream. Thus
it should always be `len(data)`, not `len(data)+1` as it currently is in
some places.

Since the first commit of hg2git.py there was a wtf comment, presumably
Rocco was confused about this common discrepancy.

We can shuffle the logic around by adding '\n' to the data, and removing
+1 to the length.

Also, the data should be written without a newline (wr_no_nl).

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
hg-fast-export.py