Mercurial > hg
annotate tests/test-mactext.t @ 14470:34f502851ff8 stable
i18n-pt_BR: synchronized with ab687820c4cc
author | Wagner Bruna <wbruna@softwareexpress.com.br> |
---|---|
date | Thu, 19 May 2011 16:25:26 -0300 |
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> |