equal
deleted
inserted
replaced
1 #!/bin/sh |
|
2 |
|
3 cat > unix2mac.py <<EOF |
|
4 import sys |
|
5 |
|
6 for path in sys.argv[1:]: |
|
7 data = file(path, 'rb').read() |
|
8 data = data.replace('\n', '\r') |
|
9 file(path, 'wb').write(data) |
|
10 EOF |
|
11 |
|
12 cat > print.py <<EOF |
|
13 import sys |
|
14 print(sys.stdin.read().replace('\n', '<LF>').replace('\r', '<CR>').replace('\0', '<NUL>')) |
|
15 EOF |
|
16 |
|
17 hg init |
|
18 echo '[hooks]' >> .hg/hgrc |
|
19 echo 'pretxncommit.cr = python:hgext.win32text.forbidcr' >> .hg/hgrc |
|
20 echo 'pretxnchangegroup.cr = python:hgext.win32text.forbidcr' >> .hg/hgrc |
|
21 cat .hg/hgrc |
|
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 hg cat f | python print.py |
|
32 cat f | python print.py |
|