Skip to content

Fix: Largefile with CRLF in .hglf file#351

Merged
frej merged 1 commit intofrej:masterfrom
zingsheim:FixLargefilesCRLF
Mar 22, 2026
Merged

Fix: Largefile with CRLF in .hglf file#351
frej merged 1 commit intofrej:masterfrom
zingsheim:FixLargefilesCRLF

Conversation

@zingsheim
Copy link
Contributor

Files in .hglf could contain CRLF instead of just LF line endings. The largefile export was confused by this while reading the hash.

Fixed by stripping all whitespaces from the hash.

Files in .hglf could contain CRLF instead of just LF line endings.
The largefile export was confused by this while reading the hash.

Fixed by stripping all whitespaces from the hash.
@frej
Copy link
Owner

frej commented Mar 22, 2026

This isn't the first time HG is sloppy about verifying internal data, sigh!

What about an addition to the test-suite?

@zingsheim
Copy link
Contributor Author

zingsheim commented Mar 22, 2026

What about an addition to the test-suite?

In order to reproduce it you probably have to create a hg repository on Windows with a specific setting of the line ending handling changed at the same time as the largefile was added (but this is only a guess since I only saw the failing export). I do not know how to create such a test. Especially, since I do not have a Windows version available myself.

On the repository which was supposed to be converted, the fix did its job.

For ordinary repositories, created and exported on Unix, there is already a test, (see main.t "hg large file")

@frej
Copy link
Owner

frej commented Mar 22, 2026

What about an addition to the test-suite?
In order to reproduce it you probably have to create a hg repository on Windows with a specific setting of the line ending handling changed at the same time as the largefile was added (but this is only a guess since I only saw the failing export). I do not know how to create such a test. Especially, since I do not have a Windows version available myself.

I understand you pain. I'm not interested in adding Wintendo to the test suite.

On the repository which was supposed to be converted, the fix did its job.

That's good enough for me.

For ordinary repositories, created and exported on Unix, there is already a test, (see main.t "hg large file")

Yes, I remember you previous contribution which included tests, that's why I asked.

I'll merge this as is, thank you for being a returning contributor.

@frej frej merged commit 52da2b2 into frej:master Mar 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants