Mercurial > hg
view tests/test-mq-eol @ 9079:70c707310d7a
Makefile: wrap hg.pot strings at 82 chars
By default, xgettext will wrap strings at 79 characters. This width
includes the two double-quotes and the '\n' added. Our strings are now
wrapped at 78 characters and a line can therefore be up to 82
characters wide in the .po file.
Setting the width to 82 characters ensures that xgettext does no silly
wrapping on our already-wrapped strings while still wrapping long
one-liners at 82 characters.
author | Martin Geisler <mg@lazybytes.net> |
---|---|
date | Tue, 07 Jul 2009 23:54:42 +0200 |
parents | 8b35b08724eb |
children | ea7c392f2b08 |
line wrap: on
line source
#!/bin/sh # Test interactions between mq and patch.eol echo "[extensions]" >> $HGRCPATH echo "mq=" >> $HGRCPATH cat > makepatch.py <<EOF f = file('eol.diff', 'wb') w = f.write w('test message\n') w('diff --git a/a b/a\n') w('--- a/a\n') w('+++ b/a\n') w('@@ -1,5 +1,5 @@\n') w(' a\n') w('-b\r\n') w('+y\r\n') w(' c\r\n') w(' d\n') w('-e\n') w('\ No newline at end of file\n') w('+z\r\n') w('\ No newline at end of file\r\n') EOF cat > cateol.py <<EOF import sys for line in file(sys.argv[1], 'rb'): line = line.replace('\r', '<CR>') line = line.replace('\n', '<LF>') print line EOF hg init repo cd repo echo '\.diff' > .hgignore echo '\.rej' >> .hgignore # Test different --eol values python -c 'file("a", "wb").write("a\nb\nc\nd\ne")' hg ci -Am adda python ../makepatch.py hg qimport eol.diff echo % should fail in strict mode hg qpush hg qpop echo % invalid eol hg --config patch.eol='LFCR' qpush hg qpop echo % force LF hg --config patch.eol='CRLF' qpush hg qrefresh python ../cateol.py .hg/patches/eol.diff python ../cateol.py a hg qpop echo % push again forcing LF and compare revisions hg --config patch.eol='CRLF' qpush python ../cateol.py a hg qpop echo % push again without LF and compare revisions hg qpush python ../cateol.py a hg qpop