##// END OF EJS Templates
tests: roll test-copy2.t into test-copy.t
Adrian Buehlmann -
r16856:241a3294 default
parent child Browse files
Show More
@@ -1,94 +1,214 b''
1
2 $ mkdir part1
3 $ cd part1
4
1 $ hg init
5 $ hg init
2 $ echo a > a
6 $ echo a > a
3 $ hg add a
7 $ hg add a
4 $ hg commit -m "1"
8 $ hg commit -m "1"
5 $ hg status
9 $ hg status
6 $ hg copy a b
10 $ hg copy a b
7 $ hg --config ui.portablefilenames=abort copy a con.xml
11 $ hg --config ui.portablefilenames=abort copy a con.xml
8 abort: filename contains 'con', which is reserved on Windows: 'con.xml'
12 abort: filename contains 'con', which is reserved on Windows: 'con.xml'
9 [255]
13 [255]
10 $ hg status
14 $ hg status
11 A b
15 A b
12 $ hg sum
16 $ hg sum
13 parent: 0:c19d34741b0a tip
17 parent: 0:c19d34741b0a tip
14 1
18 1
15 branch: default
19 branch: default
16 commit: 1 copied
20 commit: 1 copied
17 update: (current)
21 update: (current)
18 $ hg --debug commit -m "2"
22 $ hg --debug commit -m "2"
19 b
23 b
20 b: copy a:b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
24 b: copy a:b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
21 committed changeset 1:93580a2c28a50a56f63526fb305067e6fbf739c4
25 committed changeset 1:93580a2c28a50a56f63526fb305067e6fbf739c4
22
26
23 we should see two history entries
27 we should see two history entries
24
28
25 $ hg history -v
29 $ hg history -v
26 changeset: 1:93580a2c28a5
30 changeset: 1:93580a2c28a5
27 tag: tip
31 tag: tip
28 user: test
32 user: test
29 date: Thu Jan 01 00:00:00 1970 +0000
33 date: Thu Jan 01 00:00:00 1970 +0000
30 files: b
34 files: b
31 description:
35 description:
32 2
36 2
33
37
34
38
35 changeset: 0:c19d34741b0a
39 changeset: 0:c19d34741b0a
36 user: test
40 user: test
37 date: Thu Jan 01 00:00:00 1970 +0000
41 date: Thu Jan 01 00:00:00 1970 +0000
38 files: a
42 files: a
39 description:
43 description:
40 1
44 1
41
45
42
46
43
47
44 we should see one log entry for a
48 we should see one log entry for a
45
49
46 $ hg log a
50 $ hg log a
47 changeset: 0:c19d34741b0a
51 changeset: 0:c19d34741b0a
48 user: test
52 user: test
49 date: Thu Jan 01 00:00:00 1970 +0000
53 date: Thu Jan 01 00:00:00 1970 +0000
50 summary: 1
54 summary: 1
51
55
52
56
53 this should show a revision linked to changeset 0
57 this should show a revision linked to changeset 0
54
58
55 $ hg debugindex a
59 $ hg debugindex a
56 rev offset length base linkrev nodeid p1 p2
60 rev offset length base linkrev nodeid p1 p2
57 0 0 3 0 0 b789fdd96dc2 000000000000 000000000000
61 0 0 3 0 0 b789fdd96dc2 000000000000 000000000000
58
62
59 we should see one log entry for b
63 we should see one log entry for b
60
64
61 $ hg log b
65 $ hg log b
62 changeset: 1:93580a2c28a5
66 changeset: 1:93580a2c28a5
63 tag: tip
67 tag: tip
64 user: test
68 user: test
65 date: Thu Jan 01 00:00:00 1970 +0000
69 date: Thu Jan 01 00:00:00 1970 +0000
66 summary: 2
70 summary: 2
67
71
68
72
69 this should show a revision linked to changeset 1
73 this should show a revision linked to changeset 1
70
74
71 $ hg debugindex b
75 $ hg debugindex b
72 rev offset length base linkrev nodeid p1 p2
76 rev offset length base linkrev nodeid p1 p2
73 0 0 65 0 1 37d9b5d994ea 000000000000 000000000000
77 0 0 65 0 1 37d9b5d994ea 000000000000 000000000000
74
78
75 this should show the rename information in the metadata
79 this should show the rename information in the metadata
76
80
77 $ hg debugdata b 0 | head -3 | tail -2
81 $ hg debugdata b 0 | head -3 | tail -2
78 copy: a
82 copy: a
79 copyrev: b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
83 copyrev: b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
80
84
81 $ "$TESTDIR/md5sum.py" .hg/store/data/b.i
85 $ "$TESTDIR/md5sum.py" .hg/store/data/b.i
82 4999f120a3b88713bbefddd195cf5133 .hg/store/data/b.i
86 4999f120a3b88713bbefddd195cf5133 .hg/store/data/b.i
83 $ hg cat b > bsum
87 $ hg cat b > bsum
84 $ "$TESTDIR/md5sum.py" bsum
88 $ "$TESTDIR/md5sum.py" bsum
85 60b725f10c9c85c70d97880dfe8191b3 bsum
89 60b725f10c9c85c70d97880dfe8191b3 bsum
86 $ hg cat a > asum
90 $ hg cat a > asum
87 $ "$TESTDIR/md5sum.py" asum
91 $ "$TESTDIR/md5sum.py" asum
88 60b725f10c9c85c70d97880dfe8191b3 asum
92 60b725f10c9c85c70d97880dfe8191b3 asum
89 $ hg verify
93 $ hg verify
90 checking changesets
94 checking changesets
91 checking manifests
95 checking manifests
92 crosschecking files in changesets and manifests
96 crosschecking files in changesets and manifests
93 checking files
97 checking files
94 2 files, 2 changesets, 2 total revisions
98 2 files, 2 changesets, 2 total revisions
99
100 $ cd ..
101
102
103 $ mkdir part2
104 $ cd part2
105
106 $ hg init
107 $ echo foo > foo
108 should fail - foo is not managed
109 $ hg mv foo bar
110 foo: not copying - file is not managed
111 abort: no files to copy
112 [255]
113 $ hg st -A
114 ? foo
115 $ hg add foo
116 dry-run; print a warning that this is not a real copy; foo is added
117 $ hg mv --dry-run foo bar
118 foo has not been committed yet, so no copy data will be stored for bar.
119 $ hg st -A
120 A foo
121 should print a warning that this is not a real copy; bar is added
122 $ hg mv foo bar
123 foo has not been committed yet, so no copy data will be stored for bar.
124 $ hg st -A
125 A bar
126 should print a warning that this is not a real copy; foo is added
127 $ hg cp bar foo
128 bar has not been committed yet, so no copy data will be stored for foo.
129 $ hg rm -f bar
130 $ rm bar
131 $ hg st -A
132 A foo
133 $ hg commit -m1
134
135 moving a missing file
136 $ rm foo
137 $ hg mv foo foo3
138 foo: deleted in working copy
139 foo3 does not exist!
140 $ hg up -qC .
141
142 copy --after to a nonexistant target filename
143 $ hg cp -A foo dummy
144 foo: not recording copy - dummy does not exist
145
146 dry-run; should show that foo is clean
147 $ hg copy --dry-run foo bar
148 $ hg st -A
149 C foo
150 should show copy
151 $ hg copy foo bar
152 $ hg st -C
153 A bar
154 foo
155
156 shouldn't show copy
157 $ hg commit -m2
158 $ hg st -C
159
160 should match
161 $ hg debugindex foo
162 rev offset length base linkrev nodeid p1 p2
163 0 0 5 0 0 2ed2a3912a0b 000000000000 000000000000
164 $ hg debugrename bar
165 bar renamed from foo:2ed2a3912a0b24502043eae84ee4b279c18b90dd
166
167 $ echo bleah > foo
168 $ echo quux > bar
169 $ hg commit -m3
170
171 should not be renamed
172 $ hg debugrename bar
173 bar not renamed
174
175 $ hg copy -f foo bar
176 should show copy
177 $ hg st -C
178 M bar
179 foo
180 $ hg commit -m3
181
182 should show no parents for tip
183 $ hg debugindex bar
184 rev offset length base linkrev nodeid p1 p2
185 0 0 69 0 1 7711d36246cc 000000000000 000000000000
186 1 69 6 1 2 bdf70a2b8d03 7711d36246cc 000000000000
187 2 75 81 1 3 b2558327ea8d 000000000000 000000000000
188 should match
189 $ hg debugindex foo
190 rev offset length base linkrev nodeid p1 p2
191 0 0 5 0 0 2ed2a3912a0b 000000000000 000000000000
192 1 5 7 1 2 dd12c926cf16 2ed2a3912a0b 000000000000
193 $ hg debugrename bar
194 bar renamed from foo:dd12c926cf165e3eb4cf87b084955cb617221c17
195
196 should show no copies
197 $ hg st -C
198
199 copy --after on an added file
200 $ cp bar baz
201 $ hg add baz
202 $ hg cp -A bar baz
203 $ hg st -C
204 A baz
205 bar
206
207 foo was clean:
208 $ hg st -AC foo
209 C foo
210 but it's considered modified after a copy --after --force
211 $ hg copy -Af bar foo
212 $ hg st -AC foo
213 M foo
214 bar
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