equal
deleted
inserted
replaced
1 #!/bin/sh |
1 #!/bin/sh |
|
2 |
|
3 hg init t |
|
4 cd t |
2 |
5 |
3 cat > unix2dos.py <<EOF |
6 cat > unix2dos.py <<EOF |
4 import sys |
7 import sys |
5 |
8 |
6 for path in sys.argv[1:]: |
9 for path in sys.argv[1:]: |
12 cat > print.py <<EOF |
15 cat > print.py <<EOF |
13 import sys |
16 import sys |
14 print(sys.stdin.read().replace('\n', '<LF>').replace('\r', '<CR>').replace('\0', '<NUL>')) |
17 print(sys.stdin.read().replace('\n', '<LF>').replace('\r', '<CR>').replace('\0', '<NUL>')) |
15 EOF |
18 EOF |
16 |
19 |
17 hg init |
|
18 echo '[hooks]' >> .hg/hgrc |
20 echo '[hooks]' >> .hg/hgrc |
19 echo 'pretxncommit.crlf = python:hgext.win32text.forbidcrlf' >> .hg/hgrc |
21 echo 'pretxncommit.crlf = python:hgext.win32text.forbidcrlf' >> .hg/hgrc |
20 echo 'pretxnchangegroup.crlf = python:hgext.win32text.forbidcrlf' >> .hg/hgrc |
22 echo 'pretxnchangegroup.crlf = python:hgext.win32text.forbidcrlf' >> .hg/hgrc |
21 cat .hg/hgrc |
23 cat .hg/hgrc |
22 echo |
24 echo |
23 |
25 |
24 echo hello > f |
26 echo hello > f |
25 hg add f |
27 hg add f |
|
28 echo commit should succeed |
26 hg ci -m 1 -d'0 0' |
29 hg ci -m 1 -d'0 0' |
27 echo |
30 echo |
28 |
31 |
|
32 hg clone . ../zoz |
|
33 cp .hg/hgrc ../zoz/.hg |
|
34 |
29 python unix2dos.py f |
35 python unix2dos.py f |
30 hg ci -m 2 -d'0 0' |
36 echo commit should fail |
31 hg revert -a |
37 hg ci -m 2.1 -d'0 0' |
32 echo |
38 echo |
33 |
39 |
|
40 mv .hg/hgrc .hg/hgrc.bak |
|
41 echo commits should succeed |
|
42 hg ci -m 2 -d'0 0' |
|
43 hg cp f g |
|
44 hg ci -m 2.2 -d'0 0' |
|
45 echo |
|
46 |
|
47 echo push should fail |
|
48 hg push ../zoz |
|
49 echo |
|
50 |
|
51 mv .hg/hgrc.bak .hg/hgrc |
|
52 echo hello > f |
|
53 hg rm g |
|
54 echo commit should succeed |
|
55 hg ci -m 2.3 -d'0 0' |
|
56 echo |
|
57 |
|
58 echo push should succeed |
|
59 hg push ../zoz |
|
60 echo |
|
61 |
|
62 echo and now for something completely different |
34 mkdir d |
63 mkdir d |
35 echo hello > d/f2 |
64 echo hello > d/f2 |
36 python unix2dos.py d/f2 |
65 python unix2dos.py d/f2 |
37 hg add d/f2 |
66 hg add d/f2 |
38 hg ci -m 3 -d'0 0' |
67 hg ci -m 3 -d'0 0' |