Mercurial > hg
annotate tests/test-mactext.t @ 14282:10286a04fbd9
run-tests: remove check on --shell argument
No shell is needed when executing Python tests and finding a good
shell might be difficult/impossible on some platforms (e.g., Windows).
author | Martin Geisler <mg@aragost.com> |
---|---|
date | Mon, 09 May 2011 17:20:15 +0200 |
parents | 9446bd059da3 |
children | 1e9451476bf8 |
rev | line source |
---|---|
6481
e837dded56c7
win32text: Add macencode/macdecode
OHASHI Hideya <ohachige@gmail.com>
parents:
diff
changeset
|
1 |
12458 | 2 $ cat > unix2mac.py <<EOF |
3 > import sys | |
4 > | |
5 > for path in sys.argv[1:]: | |
6 > data = file(path, 'rb').read() | |
7 > data = data.replace('\n', '\r') | |
8 > file(path, 'wb').write(data) | |
9 > EOF | |
10 $ cat > print.py <<EOF | |
11 > import sys | |
12 > print(sys.stdin.read().replace('\n', '<LF>').replace('\r', '<CR>').replace('\0', '<NUL>')) | |
13 > EOF | |
14 $ hg init | |
15 $ echo '[hooks]' >> .hg/hgrc | |
16 $ echo 'pretxncommit.cr = python:hgext.win32text.forbidcr' >> .hg/hgrc | |
17 $ echo 'pretxnchangegroup.cr = python:hgext.win32text.forbidcr' >> .hg/hgrc | |
18 $ cat .hg/hgrc | |
19 [hooks] | |
20 pretxncommit.cr = python:hgext.win32text.forbidcr | |
21 pretxnchangegroup.cr = python:hgext.win32text.forbidcr | |
22 $ echo | |
23 | |
24 $ echo hello > f | |
25 $ hg add f | |
26 $ hg ci -m 1 | |
27 $ echo | |
28 | |
29 $ python unix2mac.py f | |
30 $ hg ci -m 2 | |
31 Attempt to commit or push text file(s) using CR line endings | |
32 in dea860dc51ec: f | |
33 transaction abort! | |
34 rollback completed | |
35 abort: pretxncommit.cr hook failed | |
36 [255] | |
37 $ hg cat f | python print.py | |
38 hello<LF> | |
39 $ cat f | python print.py | |
40 hello<CR> |