Show More
@@ -1,126 +1,253 b'' | |||||
1 | #!/bin/sh |
|
1 | commit date test | |
2 |
|
||||
3 | echo % commit date test |
|
|||
4 | hg init test |
|
|||
5 | cd test |
|
|||
6 | echo foo > foo |
|
|||
7 | hg add foo |
|
|||
8 | HGEDITOR=true hg commit -m "" |
|
|||
9 | hg commit -d '0 0' -m commit-1 |
|
|||
10 | echo foo >> foo |
|
|||
11 | hg commit -d '1 4444444' -m commit-3 |
|
|||
12 | hg commit -d '1 15.1' -m commit-4 |
|
|||
13 | hg commit -d 'foo bar' -m commit-5 |
|
|||
14 | hg commit -d ' 1 4444' -m commit-6 |
|
|||
15 | hg commit -d '111111111111 0' -m commit-7 |
|
|||
16 |
|
2 | |||
17 | echo % commit added file that has been deleted |
|
3 | $ hg init test | |
18 | echo bar > bar |
|
4 | $ cd test | |
19 | hg add bar |
|
5 | $ echo foo > foo | |
20 | rm bar |
|
6 | $ hg add foo | |
21 | hg commit -d "1000000 0" -m commit-8 |
|
7 | $ HGEDITOR=true hg commit -m "" | |
22 | hg commit -d "1000000 0" -m commit-8-2 bar |
|
8 | abort: empty commit message | |
23 |
|
9 | $ hg commit -d '0 0' -m commit-1 | ||
24 | hg -q revert -a --no-backup |
|
10 | $ echo foo >> foo | |
|
11 | $ hg commit -d '1 4444444' -m commit-3 | |||
|
12 | abort: impossible time zone offset: 4444444 | |||
|
13 | $ hg commit -d '1 15.1' -m commit-4 | |||
|
14 | abort: invalid date: '1\t15.1' | |||
|
15 | $ hg commit -d 'foo bar' -m commit-5 | |||
|
16 | abort: invalid date: 'foo bar' | |||
|
17 | $ hg commit -d ' 1 4444' -m commit-6 | |||
|
18 | $ hg commit -d '111111111111 0' -m commit-7 | |||
|
19 | abort: date exceeds 32 bits: 111111111111 | |||
25 |
|
20 | |||
26 | mkdir dir |
|
21 | commit added file that has been deleted | |
27 | echo boo > dir/file |
|
|||
28 | hg add |
|
|||
29 | hg -v commit -m commit-9 dir |
|
|||
30 |
|
||||
31 | echo > dir.file |
|
|||
32 | hg add |
|
|||
33 | hg commit -m commit-10 dir dir.file |
|
|||
34 |
|
22 | |||
35 | echo >> dir/file |
|
23 | $ echo bar > bar | |
36 | mkdir bleh |
|
24 | $ hg add bar | |
37 | mkdir dir2 |
|
25 | $ rm bar | |
38 | cd bleh |
|
26 | $ hg commit -d "1000000 0" -m commit-8 | |
39 | hg commit -m commit-11 . |
|
27 | nothing changed | |
40 | hg commit -m commit-12 ../dir ../dir2 |
|
28 | $ hg commit -d "1000000 0" -m commit-8-2 bar | |
41 | hg -v commit -m commit-13 ../dir |
|
29 | abort: bar: file not found! | |
42 | cd .. |
|
30 | ||
|
31 | $ hg -q revert -a --no-backup | |||
43 |
|
32 | |||
44 | hg commit -m commit-14 does-not-exist |
|
33 | $ mkdir dir | |
45 | ln -s foo baz |
|
34 | $ echo boo > dir/file | |
46 | hg commit -m commit-15 baz |
|
35 | $ hg add | |
47 | touch quux |
|
36 | adding dir/file | |
48 |
hg commit -m commit- |
|
37 | $ hg -v commit -m commit-9 dir | |
49 |
|
|
38 | dir/file | |
50 | hg -v commit -m commit-17 dir/file |
|
39 | committed changeset 2:d2a76177cb42 | |
51 | # An empty date was interpreted as epoch origin |
|
|||
52 | echo foo >> foo |
|
|||
53 | hg commit -d '' -m commit-no-date |
|
|||
54 | hg tip --template '{date|isodate}\n' | grep '1970' |
|
|||
55 | cd .. |
|
|||
56 |
|
40 | |||
57 | echo % partial subdir commit test |
|
41 | $ echo > dir.file | |
58 | hg init test2 |
|
42 | $ hg add | |
59 | cd test2 |
|
43 | adding dir.file | |
60 | mkdir foo |
|
44 | $ hg commit -m commit-10 dir dir.file | |
61 | echo foo > foo/foo |
|
45 | abort: dir: no match under directory! | |
62 | mkdir bar |
|
|||
63 | echo bar > bar/bar |
|
|||
64 | hg add |
|
|||
65 | hg ci -d '1000000 0' -m commit-subdir-1 foo |
|
|||
66 | hg ci -d '1000001 0' -m commit-subdir-2 bar |
|
|||
67 | echo % subdir log 1 |
|
|||
68 | hg log -v foo |
|
|||
69 | echo % subdir log 2 |
|
|||
70 | hg log -v bar |
|
|||
71 | echo % full log |
|
|||
72 | hg log -v |
|
|||
73 | cd .. |
|
|||
74 |
|
46 | |||
75 | echo % dot and subdir commit test |
|
47 | $ echo >> dir/file | |
76 | hg init test3 |
|
48 | $ mkdir bleh | |
77 | cd test3 |
|
49 | $ mkdir dir2 | |
78 | mkdir foo |
|
50 | $ cd bleh | |
79 | echo foo content > foo/plain-file |
|
51 | $ hg commit -m commit-11 . | |
80 | hg add foo/plain-file |
|
52 | abort: bleh: no match under directory! | |
81 | hg ci -d '1000000 0' -m commit-foo-subdir foo |
|
53 | $ hg commit -m commit-12 ../dir ../dir2 | |
82 | echo modified foo content > foo/plain-file |
|
54 | abort: dir2: no match under directory! | |
83 | hg ci -d '2000000 0' -m commit-foo-dot . |
|
55 | $ hg -v commit -m commit-13 ../dir | |
84 | echo % full log |
|
56 | dir/file | |
85 | hg log -v |
|
57 | committed changeset 3:1cd62a2d8db5 | |
86 | echo % subdir log |
|
58 | $ cd .. | |
87 | cd foo |
|
|||
88 | hg log . |
|
|||
89 | cd .. |
|
|||
90 | cd .. |
|
|||
91 |
|
59 | |||
92 | cd .. |
|
60 | $ hg commit -m commit-14 does-not-exist | |
93 | hg init issue1049 |
|
61 | abort: does-not-exist: No such file or directory | |
94 | cd issue1049 |
|
62 | $ ln -s foo baz | |
95 | echo a > a |
|
63 | $ hg commit -m commit-15 baz | |
96 | hg ci -Ama |
|
64 | abort: baz: file not tracked! | |
97 | echo a >> a |
|
65 | $ touch quux | |
98 | hg ci -mb |
|
66 | $ hg commit -m commit-16 quux | |
99 | hg up 0 |
|
67 | abort: quux: file not tracked! | |
100 | echo b >> a |
|
68 | $ echo >> dir/file | |
101 | hg ci -mc |
|
69 | $ hg -v commit -m commit-17 dir/file | |
102 | HGMERGE=true hg merge |
|
70 | dir/file | |
103 | echo % should fail because we are specifying a file name |
|
71 | committed changeset 4:49176991390e | |
104 | hg ci -mmerge a |
|
72 | ||
105 | echo % should fail because we are specifying a pattern |
|
73 | An empty date was interpreted as epoch origin | |
106 | hg ci -mmerge -I a |
|
74 | ||
107 | echo % should succeed |
|
75 | $ echo foo >> foo | |
108 | hg ci -mmerge |
|
76 | $ hg commit -d '' -m commit-no-date | |
109 | cd .. |
|
77 | $ hg tip --template '{date|isodate}\n' | grep '1970' | |
|
78 | $ cd .. | |||
110 |
|
79 | |||
111 |
|
80 | |||
112 | echo % test commit message content |
|
81 | partial subdir commit test | |
113 | hg init commitmsg |
|
82 | ||
114 | cd commitmsg |
|
83 | $ hg init test2 | |
115 | echo changed > changed |
|
84 | $ cd test2 | |
116 | echo removed > removed |
|
85 | $ mkdir foo | |
117 | hg ci -qAm init |
|
86 | $ echo foo > foo/foo | |
|
87 | $ mkdir bar | |||
|
88 | $ echo bar > bar/bar | |||
|
89 | $ hg add | |||
|
90 | adding bar/bar | |||
|
91 | adding foo/foo | |||
|
92 | $ hg ci -d '1000000 0' -m commit-subdir-1 foo | |||
|
93 | $ hg ci -d '1000001 0' -m commit-subdir-2 bar | |||
|
94 | ||||
|
95 | subdir log 1 | |||
|
96 | ||||
|
97 | $ hg log -v foo | |||
|
98 | changeset: 0:6ef3cb06bb80 | |||
|
99 | user: test | |||
|
100 | date: Mon Jan 12 13:46:40 1970 +0000 | |||
|
101 | files: foo/foo | |||
|
102 | description: | |||
|
103 | commit-subdir-1 | |||
|
104 | ||||
|
105 | ||||
|
106 | ||||
|
107 | subdir log 2 | |||
|
108 | ||||
|
109 | $ hg log -v bar | |||
|
110 | changeset: 1:f2e51572cf5a | |||
|
111 | tag: tip | |||
|
112 | user: test | |||
|
113 | date: Mon Jan 12 13:46:41 1970 +0000 | |||
|
114 | files: bar/bar | |||
|
115 | description: | |||
|
116 | commit-subdir-2 | |||
|
117 | ||||
|
118 | ||||
|
119 | ||||
|
120 | full log | |||
|
121 | ||||
|
122 | $ hg log -v | |||
|
123 | changeset: 1:f2e51572cf5a | |||
|
124 | tag: tip | |||
|
125 | user: test | |||
|
126 | date: Mon Jan 12 13:46:41 1970 +0000 | |||
|
127 | files: bar/bar | |||
|
128 | description: | |||
|
129 | commit-subdir-2 | |||
|
130 | ||||
|
131 | ||||
|
132 | changeset: 0:6ef3cb06bb80 | |||
|
133 | user: test | |||
|
134 | date: Mon Jan 12 13:46:40 1970 +0000 | |||
|
135 | files: foo/foo | |||
|
136 | description: | |||
|
137 | commit-subdir-1 | |||
|
138 | ||||
|
139 | ||||
|
140 | $ cd .. | |||
|
141 | ||||
|
142 | ||||
|
143 | dot and subdir commit test | |||
|
144 | ||||
|
145 | $ hg init test3 | |||
|
146 | $ cd test3 | |||
|
147 | $ mkdir foo | |||
|
148 | $ echo foo content > foo/plain-file | |||
|
149 | $ hg add foo/plain-file | |||
|
150 | $ hg ci -d '1000000 0' -m commit-foo-subdir foo | |||
|
151 | $ echo modified foo content > foo/plain-file | |||
|
152 | $ hg ci -d '2000000 0' -m commit-foo-dot . | |||
|
153 | ||||
|
154 | full log | |||
118 |
|
155 | |||
119 | hg rm removed |
|
156 | $ hg log -v | |
120 | echo changed >> changed |
|
157 | changeset: 1:d9180e04fa8a | |
121 | echo added > added |
|
158 | tag: tip | |
122 | hg add added |
|
159 | user: test | |
123 | HGEDITOR=cat hg ci -A |
|
160 | date: Sat Jan 24 03:33:20 1970 +0000 | |
124 | cd .. |
|
161 | files: foo/plain-file | |
|
162 | description: | |||
|
163 | commit-foo-dot | |||
|
164 | ||||
|
165 | ||||
|
166 | changeset: 0:80b572aaf098 | |||
|
167 | user: test | |||
|
168 | date: Mon Jan 12 13:46:40 1970 +0000 | |||
|
169 | files: foo/plain-file | |||
|
170 | description: | |||
|
171 | commit-foo-subdir | |||
|
172 | ||||
|
173 | ||||
|
174 | ||||
|
175 | subdir log | |||
|
176 | ||||
|
177 | $ cd foo | |||
|
178 | $ hg log . | |||
|
179 | changeset: 1:d9180e04fa8a | |||
|
180 | tag: tip | |||
|
181 | user: test | |||
|
182 | date: Sat Jan 24 03:33:20 1970 +0000 | |||
|
183 | summary: commit-foo-dot | |||
|
184 | ||||
|
185 | changeset: 0:80b572aaf098 | |||
|
186 | user: test | |||
|
187 | date: Mon Jan 12 13:46:40 1970 +0000 | |||
|
188 | summary: commit-foo-subdir | |||
|
189 | ||||
|
190 | $ cd .. | |||
|
191 | $ cd .. | |||
125 |
|
192 | |||
126 | exit 0 |
|
193 | $ cd .. | |
|
194 | $ hg init issue1049 | |||
|
195 | $ cd issue1049 | |||
|
196 | $ echo a > a | |||
|
197 | $ hg ci -Ama | |||
|
198 | adding a | |||
|
199 | $ echo a >> a | |||
|
200 | $ hg ci -mb | |||
|
201 | $ hg up 0 | |||
|
202 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
203 | $ echo b >> a | |||
|
204 | $ hg ci -mc | |||
|
205 | created new head | |||
|
206 | $ HGMERGE=true hg merge | |||
|
207 | merging a | |||
|
208 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |||
|
209 | (branch merge, don't forget to commit) | |||
|
210 | ||||
|
211 | should fail because we are specifying a file name | |||
|
212 | ||||
|
213 | $ hg ci -mmerge a | |||
|
214 | abort: cannot partially commit a merge (do not specify files or patterns) | |||
|
215 | ||||
|
216 | should fail because we are specifying a pattern | |||
|
217 | ||||
|
218 | $ hg ci -mmerge -I a | |||
|
219 | abort: cannot partially commit a merge (do not specify files or patterns) | |||
|
220 | ||||
|
221 | should succeed | |||
|
222 | ||||
|
223 | $ hg ci -mmerge | |||
|
224 | $ cd .. | |||
|
225 | ||||
|
226 | ||||
|
227 | test commit message content | |||
|
228 | ||||
|
229 | $ hg init commitmsg | |||
|
230 | $ cd commitmsg | |||
|
231 | $ echo changed > changed | |||
|
232 | $ echo removed > removed | |||
|
233 | $ hg ci -qAm init | |||
|
234 | ||||
|
235 | $ hg rm removed | |||
|
236 | $ echo changed >> changed | |||
|
237 | $ echo added > added | |||
|
238 | $ hg add added | |||
|
239 | $ HGEDITOR=cat hg ci -A | |||
|
240 | ||||
|
241 | ||||
|
242 | HG: Enter commit message. Lines beginning with 'HG:' are removed. | |||
|
243 | HG: Leave message empty to abort commit. | |||
|
244 | HG: -- | |||
|
245 | HG: user: test | |||
|
246 | HG: branch 'default' | |||
|
247 | HG: added added | |||
|
248 | HG: changed changed | |||
|
249 | HG: removed removed | |||
|
250 | abort: empty commit message | |||
|
251 | $ cd .. | |||
|
252 | ||||
|
253 | $ exit 0 |
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