##// 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
1 Testing cloning with the EOL extension
2
3 $ cat > $HGRCPATH <<EOF
4 > [diff]
5 > git = True
6 >
7 > [extensions]
8 > eol =
9 >
10 > [eol]
11 > native = CRLF
12 > EOF
2
13
3 cat > $HGRCPATH <<EOF
14 setup repository
4 [diff]
5 git = True
6
15
7 [extensions]
16 $ hg init repo
8 eol =
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
26
27 Clone
9
28
10 [eol]
29 $ cd ..
11 native = CRLF
30 $ hg clone repo repo-2
12 EOF
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 ..
46
47 Test clone of repo with .hgeol in working dir, but no .hgeol in tip
13
48
14 echo "% setup repository"
49 $ hg clone repo repo-3
15 hg init repo
50 updating to branch default
16 cd repo
51 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
52 $ cd repo-3
53
54 $ python $TESTDIR/printrepr.py < a.txt
55 first
56 second
57 third
58
59 Test clone of revision with .hgeol
17
60
18 cat > .hgeol <<EOF
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
19 [patterns]
72 [patterns]
20 **.txt = native
73 **.txt = native
21 EOF
22
74
23 printf "first\r\nsecond\r\nthird\r\n" > a.txt
75 $ python $TESTDIR/printrepr.py < a.txt
24 hg commit --addremove -m 'checkin'
76 first\r
25 cd ..
77 second\r
26
78 third\r
27 echo "% hg clone repo repo-2"
28 hg clone repo repo-2
29 cd repo-2
30
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
35
36 hg remove .hgeol
37 hg commit -m 'remove eol'
38 hg push --quiet
39
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
46
47 echo '% printrepr.py a.txt'
48 python $TESTDIR/printrepr.py < a.txt
49
50 cd ..
51
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
56
57 echo '% cat .hgeol'
58 cat .hgeol
59
60 echo '% printrepr.py a.txt'
61 python $TESTDIR/printrepr.py < a.txt
62
63 cd ..
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now