##// END OF EJS Templates
tests: unify test-eol-clone
Matt Mackall -
r12422:4263359f default
parent child Browse files
Show More
@@ -1,63 +1,78
1 #!/bin/sh
2
3 cat > $HGRCPATH <<EOF
4 [diff]
5 git = True
1 Testing cloning with the EOL extension
6 2
7 [extensions]
8 eol =
9
10 [eol]
11 native = CRLF
12 EOF
3 $ cat > $HGRCPATH <<EOF
4 > [diff]
5 > git = True
6 >
7 > [extensions]
8 > eol =
9 >
10 > [eol]
11 > native = CRLF
12 > EOF
13 13
14 echo "% setup repository"
15 hg init repo
16 cd repo
14 setup repository
17 15
18 cat > .hgeol <<EOF
19 [patterns]
20 **.txt = native
21 EOF
16 $ hg init repo
17 $ cd repo
18 $ cat > .hgeol <<EOF
19 > [patterns]
20 > **.txt = native
21 > EOF
22 $ printf "first\r\nsecond\r\nthird\r\n" > a.txt
23 $ hg commit --addremove -m 'checkin'
24 adding .hgeol
25 adding a.txt
22 26
23 printf "first\r\nsecond\r\nthird\r\n" > a.txt
24 hg commit --addremove -m 'checkin'
25 cd ..
26
27 echo "% hg clone repo repo-2"
28 hg clone repo repo-2
29 cd repo-2
27 Clone
30 28
31 echo '% printrepr.py a.txt'
32 python $TESTDIR/printrepr.py < a.txt
33 echo '% hg cat a.txt'
34 hg cat a.txt | python $TESTDIR/printrepr.py
29 $ cd ..
30 $ hg clone repo repo-2
31 updating to branch default
32 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
33 $ cd repo-2
34 $ python $TESTDIR/printrepr.py < a.txt
35 first\r
36 second\r
37 third\r
38 $ hg cat a.txt | python $TESTDIR/printrepr.py
39 first
40 second
41 third
42 $ hg remove .hgeol
43 $ hg commit -m 'remove eol'
44 $ hg push --quiet
45 $ cd ..
35 46
36 hg remove .hgeol
37 hg commit -m 'remove eol'
38 hg push --quiet
47 Test clone of repo with .hgeol in working dir, but no .hgeol in tip
39 48
40 cd ..
41
42 # Test clone of repo with .hgeol in working dir, but no .hgeol in tip
43 echo "% hg clone repo repo-3"
44 hg clone repo repo-3
45 cd repo-3
49 $ hg clone repo repo-3
50 updating to branch default
51 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
52 $ cd repo-3
46 53
47 echo '% printrepr.py a.txt'
48 python $TESTDIR/printrepr.py < a.txt
54 $ python $TESTDIR/printrepr.py < a.txt
55 first
56 second
57 third
49 58
50 cd ..
59 Test clone of revision with .hgeol
51 60
52 # Test clone of revision with .hgeol
53 echo "% hg clone -r 1 repo repo-4"
54 hg clone -r 0 repo repo-4
55 cd repo-4
61 $ cd ..
62 $ hg clone -r 0 repo repo-4
63 requesting all changes
64 adding changesets
65 adding manifests
66 adding file changes
67 added 1 changesets with 2 changes to 2 files
68 updating to branch default
69 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
70 $ cd repo-4
71 $ cat .hgeol
72 [patterns]
73 **.txt = native
56 74
57 echo '% cat .hgeol'
58 cat .hgeol
59
60 echo '% printrepr.py a.txt'
61 python $TESTDIR/printrepr.py < a.txt
62
63 cd ..
75 $ python $TESTDIR/printrepr.py < a.txt
76 first\r
77 second\r
78 third\r
1 NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now