##// END OF EJS Templates
test for git empty new files
Brendan Cully -
r3589:1c9b6f12 default
parent child Browse files
Show More
@@ -1,122 +1,129
1 1 #!/bin/sh
2 2
3 3 hg init a
4 4 cd a
5 5
6 6 echo % new file
7 7 hg import -mnew - <<EOF
8 8 diff --git a/new b/new
9 9 new file mode 100644
10 10 index 0000000..7898192
11 11 --- /dev/null
12 12 +++ b/new
13 13 @@ -0,0 +1 @@
14 14 +a
15 15 EOF
16 16
17 echo % new empty file
18 hg import -mempty - <<EOF
19 diff --git a/empty b/empty
20 new file mode 100644
21 EOF
22 hg locate empty
23
17 24 echo % chmod +x
18 25 hg import -msetx - <<EOF
19 26 diff --git a/new b/new
20 27 old mode 100644
21 28 new mode 100755
22 29 EOF
23 30
24 31 test -x new || echo failed
25 32
26 33 echo % copy
27 34 hg import -mcopy - <<EOF
28 35 diff --git a/new b/copy
29 36 old mode 100755
30 37 new mode 100644
31 38 similarity index 100%
32 39 copy from new
33 40 copy to copy
34 41 diff --git a/new b/copyx
35 42 similarity index 100%
36 43 copy from new
37 44 copy to copyx
38 45 EOF
39 46
40 47 test -f copy -a ! -x copy || echo failed
41 48 test -x copyx || echo failed
42 49 cat copy
43 50 hg cat copy
44 51
45 52 echo % rename
46 53 hg import -mrename - <<EOF
47 54 diff --git a/copy b/rename
48 55 similarity index 100%
49 56 rename from copy
50 57 rename to rename
51 58 EOF
52 59
53 60 hg locate
54 61
55 62 echo % delete
56 63 hg import -mdelete - <<EOF
57 64 diff --git a/copyx b/copyx
58 65 deleted file mode 100755
59 66 index 7898192..0000000
60 67 --- a/copyx
61 68 +++ /dev/null
62 69 @@ -1 +0,0 @@
63 70 -a
64 71 EOF
65 72
66 73 hg locate
67 74 test -f copyx && echo failed || true
68 75
69 76 echo % regular diff
70 77 hg import -mregular - <<EOF
71 78 diff --git a/rename b/rename
72 79 index 7898192..72e1fe3 100644
73 80 --- a/rename
74 81 +++ b/rename
75 82 @@ -1 +1,5 @@
76 83 a
77 84 +a
78 85 +a
79 86 +a
80 87 +a
81 88 EOF
82 89
83 90 echo % copy and modify
84 91 hg import -mcopymod - <<EOF
85 92 diff --git a/rename b/copy2
86 93 similarity index 80%
87 94 copy from rename
88 95 copy to copy2
89 96 index 72e1fe3..b53c148 100644
90 97 --- a/rename
91 98 +++ b/copy2
92 99 @@ -1,5 +1,5 @@
93 100 a
94 101 a
95 102 -a
96 103 +b
97 104 a
98 105 a
99 106 EOF
100 107
101 108 hg cat copy2
102 109
103 110 echo % rename and modify
104 111 hg import -mrenamemod - <<EOF
105 112 diff --git a/copy2 b/rename2
106 113 similarity index 80%
107 114 rename from copy2
108 115 rename to rename2
109 116 index b53c148..8f81e29 100644
110 117 --- a/copy2
111 118 +++ b/rename2
112 119 @@ -1,5 +1,5 @@
113 120 a
114 121 a
115 122 b
116 123 -a
117 124 +c
118 125 a
119 126 EOF
120 127
121 128 hg locate copy2
122 129 hg cat rename2
@@ -1,34 +1,39
1 1 % new file
2 2 applying patch from stdin
3 % new empty file
4 applying patch from stdin
5 empty
3 6 % chmod +x
4 7 applying patch from stdin
5 8 % copy
6 9 applying patch from stdin
7 10 a
8 11 a
9 12 % rename
10 13 applying patch from stdin
11 14 copyx
15 empty
12 16 new
13 17 rename
14 18 % delete
15 19 applying patch from stdin
20 empty
16 21 new
17 22 rename
18 23 % regular diff
19 24 applying patch from stdin
20 25 % copy and modify
21 26 applying patch from stdin
22 27 a
23 28 a
24 29 b
25 30 a
26 31 a
27 32 % rename and modify
28 33 applying patch from stdin
29 34 copy2: No such file or directory
30 35 a
31 36 a
32 37 b
33 38 c
34 39 a
General Comments 0
You need to be logged in to leave comments. Login now