Show More
@@ -1,670 +1,678 b'' | |||||
1 | Prepare repo a: |
|
1 | Prepare repo a: | |
2 |
|
2 | |||
3 | $ hg init a |
|
3 | $ hg init a | |
4 | $ cd a |
|
4 | $ cd a | |
5 | $ echo a > a |
|
5 | $ echo a > a | |
6 | $ hg add a |
|
6 | $ hg add a | |
7 | $ hg commit -m test |
|
7 | $ hg commit -m test | |
8 | $ echo first line > b |
|
8 | $ echo first line > b | |
9 | $ hg add b |
|
9 | $ hg add b | |
10 |
|
10 | |||
11 | Create a non-inlined filelog: |
|
11 | Create a non-inlined filelog: | |
12 |
|
12 | |||
13 | $ $PYTHON -c 'file("data1", "wb").write("".join("%s\n" % x for x in range(10000)))' |
|
13 | $ $PYTHON -c 'file("data1", "wb").write("".join("%s\n" % x for x in range(10000)))' | |
14 | $ for j in 0 1 2 3 4 5 6 7 8 9; do |
|
14 | $ for j in 0 1 2 3 4 5 6 7 8 9; do | |
15 | > cat data1 >> b |
|
15 | > cat data1 >> b | |
16 | > hg commit -m test |
|
16 | > hg commit -m test | |
17 | > done |
|
17 | > done | |
18 |
|
18 | |||
19 | List files in store/data (should show a 'b.d'): |
|
19 | List files in store/data (should show a 'b.d'): | |
20 |
|
20 | |||
21 | $ for i in .hg/store/data/*; do |
|
21 | $ for i in .hg/store/data/*; do | |
22 | > echo $i |
|
22 | > echo $i | |
23 | > done |
|
23 | > done | |
24 | .hg/store/data/a.i |
|
24 | .hg/store/data/a.i | |
25 | .hg/store/data/b.d |
|
25 | .hg/store/data/b.d | |
26 | .hg/store/data/b.i |
|
26 | .hg/store/data/b.i | |
27 |
|
27 | |||
28 | Trigger branchcache creation: |
|
28 | Trigger branchcache creation: | |
29 |
|
29 | |||
30 | $ hg branches |
|
30 | $ hg branches | |
31 | default 10:a7949464abda |
|
31 | default 10:a7949464abda | |
32 | $ ls .hg/cache |
|
32 | $ ls .hg/cache | |
33 | branch2-served |
|
33 | branch2-served | |
34 | rbc-names-v1 |
|
34 | rbc-names-v1 | |
35 | rbc-revs-v1 |
|
35 | rbc-revs-v1 | |
36 |
|
36 | |||
37 | Default operation: |
|
37 | Default operation: | |
38 |
|
38 | |||
39 | $ hg clone . ../b |
|
39 | $ hg clone . ../b | |
40 | updating to branch default |
|
40 | updating to branch default | |
41 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
41 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
42 | $ cd ../b |
|
42 | $ cd ../b | |
43 |
|
43 | |||
44 | Ensure branchcache got copied over: |
|
44 | Ensure branchcache got copied over: | |
45 |
|
45 | |||
46 | $ ls .hg/cache |
|
46 | $ ls .hg/cache | |
47 | branch2-served |
|
47 | branch2-served | |
48 |
|
48 | |||
49 | $ cat a |
|
49 | $ cat a | |
50 | a |
|
50 | a | |
51 | $ hg verify |
|
51 | $ hg verify | |
52 | checking changesets |
|
52 | checking changesets | |
53 | checking manifests |
|
53 | checking manifests | |
54 | crosschecking files in changesets and manifests |
|
54 | crosschecking files in changesets and manifests | |
55 | checking files |
|
55 | checking files | |
56 | 2 files, 11 changesets, 11 total revisions |
|
56 | 2 files, 11 changesets, 11 total revisions | |
57 |
|
57 | |||
58 | Invalid dest '' must abort: |
|
58 | Invalid dest '' must abort: | |
59 |
|
59 | |||
60 | $ hg clone . '' |
|
60 | $ hg clone . '' | |
61 | abort: empty destination path is not valid |
|
61 | abort: empty destination path is not valid | |
62 | [255] |
|
62 | [255] | |
63 |
|
63 | |||
64 | No update, with debug option: |
|
64 | No update, with debug option: | |
65 |
|
65 | |||
66 | #if hardlink |
|
66 | #if hardlink | |
67 | $ hg --debug clone -U . ../c |
|
67 | $ hg --debug clone -U . ../c | |
68 | linking: 1 |
|
68 | linking: 1 | |
69 | linking: 2 |
|
69 | linking: 2 | |
70 | linking: 3 |
|
70 | linking: 3 | |
71 | linking: 4 |
|
71 | linking: 4 | |
72 | linking: 5 |
|
72 | linking: 5 | |
73 | linking: 6 |
|
73 | linking: 6 | |
74 | linking: 7 |
|
74 | linking: 7 | |
75 | linking: 8 |
|
75 | linking: 8 | |
76 | linked 8 files |
|
76 | linked 8 files | |
77 | #else |
|
77 | #else | |
78 | $ hg --debug clone -U . ../c |
|
78 | $ hg --debug clone -U . ../c | |
|
79 | linking: 1 | |||
|
80 | copying: 2 | |||
|
81 | copying: 3 | |||
|
82 | copying: 4 | |||
|
83 | copying: 5 | |||
|
84 | copying: 6 | |||
|
85 | copying: 7 | |||
|
86 | copying: 8 | |||
79 | copied 8 files |
|
87 | copied 8 files | |
80 | #endif |
|
88 | #endif | |
81 | $ cd ../c |
|
89 | $ cd ../c | |
82 |
|
90 | |||
83 | Ensure branchcache got copied over: |
|
91 | Ensure branchcache got copied over: | |
84 |
|
92 | |||
85 | $ ls .hg/cache |
|
93 | $ ls .hg/cache | |
86 | branch2-served |
|
94 | branch2-served | |
87 |
|
95 | |||
88 | $ cat a 2>/dev/null || echo "a not present" |
|
96 | $ cat a 2>/dev/null || echo "a not present" | |
89 | a not present |
|
97 | a not present | |
90 | $ hg verify |
|
98 | $ hg verify | |
91 | checking changesets |
|
99 | checking changesets | |
92 | checking manifests |
|
100 | checking manifests | |
93 | crosschecking files in changesets and manifests |
|
101 | crosschecking files in changesets and manifests | |
94 | checking files |
|
102 | checking files | |
95 | 2 files, 11 changesets, 11 total revisions |
|
103 | 2 files, 11 changesets, 11 total revisions | |
96 |
|
104 | |||
97 | Default destination: |
|
105 | Default destination: | |
98 |
|
106 | |||
99 | $ mkdir ../d |
|
107 | $ mkdir ../d | |
100 | $ cd ../d |
|
108 | $ cd ../d | |
101 | $ hg clone ../a |
|
109 | $ hg clone ../a | |
102 | destination directory: a |
|
110 | destination directory: a | |
103 | updating to branch default |
|
111 | updating to branch default | |
104 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
112 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
105 | $ cd a |
|
113 | $ cd a | |
106 | $ hg cat a |
|
114 | $ hg cat a | |
107 | a |
|
115 | a | |
108 | $ cd ../.. |
|
116 | $ cd ../.. | |
109 |
|
117 | |||
110 | Check that we drop the 'file:' from the path before writing the .hgrc: |
|
118 | Check that we drop the 'file:' from the path before writing the .hgrc: | |
111 |
|
119 | |||
112 | $ hg clone file:a e |
|
120 | $ hg clone file:a e | |
113 | updating to branch default |
|
121 | updating to branch default | |
114 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
122 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
115 | $ grep 'file:' e/.hg/hgrc |
|
123 | $ grep 'file:' e/.hg/hgrc | |
116 | [1] |
|
124 | [1] | |
117 |
|
125 | |||
118 | Check that path aliases are expanded: |
|
126 | Check that path aliases are expanded: | |
119 |
|
127 | |||
120 | $ hg clone -q -U --config 'paths.foobar=a#0' foobar f |
|
128 | $ hg clone -q -U --config 'paths.foobar=a#0' foobar f | |
121 | $ hg -R f showconfig paths.default |
|
129 | $ hg -R f showconfig paths.default | |
122 | $TESTTMP/a#0 (glob) |
|
130 | $TESTTMP/a#0 (glob) | |
123 |
|
131 | |||
124 | Use --pull: |
|
132 | Use --pull: | |
125 |
|
133 | |||
126 | $ hg clone --pull a g |
|
134 | $ hg clone --pull a g | |
127 | requesting all changes |
|
135 | requesting all changes | |
128 | adding changesets |
|
136 | adding changesets | |
129 | adding manifests |
|
137 | adding manifests | |
130 | adding file changes |
|
138 | adding file changes | |
131 | added 11 changesets with 11 changes to 2 files |
|
139 | added 11 changesets with 11 changes to 2 files | |
132 | updating to branch default |
|
140 | updating to branch default | |
133 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
141 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
134 | $ hg -R g verify |
|
142 | $ hg -R g verify | |
135 | checking changesets |
|
143 | checking changesets | |
136 | checking manifests |
|
144 | checking manifests | |
137 | crosschecking files in changesets and manifests |
|
145 | crosschecking files in changesets and manifests | |
138 | checking files |
|
146 | checking files | |
139 | 2 files, 11 changesets, 11 total revisions |
|
147 | 2 files, 11 changesets, 11 total revisions | |
140 |
|
148 | |||
141 | Invalid dest '' with --pull must abort (issue2528): |
|
149 | Invalid dest '' with --pull must abort (issue2528): | |
142 |
|
150 | |||
143 | $ hg clone --pull a '' |
|
151 | $ hg clone --pull a '' | |
144 | abort: empty destination path is not valid |
|
152 | abort: empty destination path is not valid | |
145 | [255] |
|
153 | [255] | |
146 |
|
154 | |||
147 | Clone to '.': |
|
155 | Clone to '.': | |
148 |
|
156 | |||
149 | $ mkdir h |
|
157 | $ mkdir h | |
150 | $ cd h |
|
158 | $ cd h | |
151 | $ hg clone ../a . |
|
159 | $ hg clone ../a . | |
152 | updating to branch default |
|
160 | updating to branch default | |
153 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
161 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
154 | $ cd .. |
|
162 | $ cd .. | |
155 |
|
163 | |||
156 |
|
164 | |||
157 | *** Tests for option -u *** |
|
165 | *** Tests for option -u *** | |
158 |
|
166 | |||
159 | Adding some more history to repo a: |
|
167 | Adding some more history to repo a: | |
160 |
|
168 | |||
161 | $ cd a |
|
169 | $ cd a | |
162 | $ hg tag ref1 |
|
170 | $ hg tag ref1 | |
163 | $ echo the quick brown fox >a |
|
171 | $ echo the quick brown fox >a | |
164 | $ hg ci -m "hacked default" |
|
172 | $ hg ci -m "hacked default" | |
165 | $ hg up ref1 |
|
173 | $ hg up ref1 | |
166 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
174 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
167 | $ hg branch stable |
|
175 | $ hg branch stable | |
168 | marked working directory as branch stable |
|
176 | marked working directory as branch stable | |
169 | (branches are permanent and global, did you want a bookmark?) |
|
177 | (branches are permanent and global, did you want a bookmark?) | |
170 | $ echo some text >a |
|
178 | $ echo some text >a | |
171 | $ hg ci -m "starting branch stable" |
|
179 | $ hg ci -m "starting branch stable" | |
172 | $ hg tag ref2 |
|
180 | $ hg tag ref2 | |
173 | $ echo some more text >a |
|
181 | $ echo some more text >a | |
174 | $ hg ci -m "another change for branch stable" |
|
182 | $ hg ci -m "another change for branch stable" | |
175 | $ hg up ref2 |
|
183 | $ hg up ref2 | |
176 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
184 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
177 | $ hg parents |
|
185 | $ hg parents | |
178 | changeset: 13:e8ece76546a6 |
|
186 | changeset: 13:e8ece76546a6 | |
179 | branch: stable |
|
187 | branch: stable | |
180 | tag: ref2 |
|
188 | tag: ref2 | |
181 | parent: 10:a7949464abda |
|
189 | parent: 10:a7949464abda | |
182 | user: test |
|
190 | user: test | |
183 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
191 | date: Thu Jan 01 00:00:00 1970 +0000 | |
184 | summary: starting branch stable |
|
192 | summary: starting branch stable | |
185 |
|
193 | |||
186 |
|
194 | |||
187 | Repo a has two heads: |
|
195 | Repo a has two heads: | |
188 |
|
196 | |||
189 | $ hg heads |
|
197 | $ hg heads | |
190 | changeset: 15:0aae7cf88f0d |
|
198 | changeset: 15:0aae7cf88f0d | |
191 | branch: stable |
|
199 | branch: stable | |
192 | tag: tip |
|
200 | tag: tip | |
193 | user: test |
|
201 | user: test | |
194 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
202 | date: Thu Jan 01 00:00:00 1970 +0000 | |
195 | summary: another change for branch stable |
|
203 | summary: another change for branch stable | |
196 |
|
204 | |||
197 | changeset: 12:f21241060d6a |
|
205 | changeset: 12:f21241060d6a | |
198 | user: test |
|
206 | user: test | |
199 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
207 | date: Thu Jan 01 00:00:00 1970 +0000 | |
200 | summary: hacked default |
|
208 | summary: hacked default | |
201 |
|
209 | |||
202 |
|
210 | |||
203 | $ cd .. |
|
211 | $ cd .. | |
204 |
|
212 | |||
205 |
|
213 | |||
206 | Testing --noupdate with --updaterev (must abort): |
|
214 | Testing --noupdate with --updaterev (must abort): | |
207 |
|
215 | |||
208 | $ hg clone --noupdate --updaterev 1 a ua |
|
216 | $ hg clone --noupdate --updaterev 1 a ua | |
209 | abort: cannot specify both --noupdate and --updaterev |
|
217 | abort: cannot specify both --noupdate and --updaterev | |
210 | [255] |
|
218 | [255] | |
211 |
|
219 | |||
212 |
|
220 | |||
213 | Testing clone -u: |
|
221 | Testing clone -u: | |
214 |
|
222 | |||
215 | $ hg clone -u . a ua |
|
223 | $ hg clone -u . a ua | |
216 | updating to branch stable |
|
224 | updating to branch stable | |
217 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
225 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
218 |
|
226 | |||
219 | Repo ua has both heads: |
|
227 | Repo ua has both heads: | |
220 |
|
228 | |||
221 | $ hg -R ua heads |
|
229 | $ hg -R ua heads | |
222 | changeset: 15:0aae7cf88f0d |
|
230 | changeset: 15:0aae7cf88f0d | |
223 | branch: stable |
|
231 | branch: stable | |
224 | tag: tip |
|
232 | tag: tip | |
225 | user: test |
|
233 | user: test | |
226 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
234 | date: Thu Jan 01 00:00:00 1970 +0000 | |
227 | summary: another change for branch stable |
|
235 | summary: another change for branch stable | |
228 |
|
236 | |||
229 | changeset: 12:f21241060d6a |
|
237 | changeset: 12:f21241060d6a | |
230 | user: test |
|
238 | user: test | |
231 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
239 | date: Thu Jan 01 00:00:00 1970 +0000 | |
232 | summary: hacked default |
|
240 | summary: hacked default | |
233 |
|
241 | |||
234 |
|
242 | |||
235 | Same revision checked out in repo a and ua: |
|
243 | Same revision checked out in repo a and ua: | |
236 |
|
244 | |||
237 | $ hg -R a parents --template "{node|short}\n" |
|
245 | $ hg -R a parents --template "{node|short}\n" | |
238 | e8ece76546a6 |
|
246 | e8ece76546a6 | |
239 | $ hg -R ua parents --template "{node|short}\n" |
|
247 | $ hg -R ua parents --template "{node|short}\n" | |
240 | e8ece76546a6 |
|
248 | e8ece76546a6 | |
241 |
|
249 | |||
242 | $ rm -r ua |
|
250 | $ rm -r ua | |
243 |
|
251 | |||
244 |
|
252 | |||
245 | Testing clone --pull -u: |
|
253 | Testing clone --pull -u: | |
246 |
|
254 | |||
247 | $ hg clone --pull -u . a ua |
|
255 | $ hg clone --pull -u . a ua | |
248 | requesting all changes |
|
256 | requesting all changes | |
249 | adding changesets |
|
257 | adding changesets | |
250 | adding manifests |
|
258 | adding manifests | |
251 | adding file changes |
|
259 | adding file changes | |
252 | added 16 changesets with 16 changes to 3 files (+1 heads) |
|
260 | added 16 changesets with 16 changes to 3 files (+1 heads) | |
253 | updating to branch stable |
|
261 | updating to branch stable | |
254 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
262 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
255 |
|
263 | |||
256 | Repo ua has both heads: |
|
264 | Repo ua has both heads: | |
257 |
|
265 | |||
258 | $ hg -R ua heads |
|
266 | $ hg -R ua heads | |
259 | changeset: 15:0aae7cf88f0d |
|
267 | changeset: 15:0aae7cf88f0d | |
260 | branch: stable |
|
268 | branch: stable | |
261 | tag: tip |
|
269 | tag: tip | |
262 | user: test |
|
270 | user: test | |
263 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
271 | date: Thu Jan 01 00:00:00 1970 +0000 | |
264 | summary: another change for branch stable |
|
272 | summary: another change for branch stable | |
265 |
|
273 | |||
266 | changeset: 12:f21241060d6a |
|
274 | changeset: 12:f21241060d6a | |
267 | user: test |
|
275 | user: test | |
268 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
276 | date: Thu Jan 01 00:00:00 1970 +0000 | |
269 | summary: hacked default |
|
277 | summary: hacked default | |
270 |
|
278 | |||
271 |
|
279 | |||
272 | Same revision checked out in repo a and ua: |
|
280 | Same revision checked out in repo a and ua: | |
273 |
|
281 | |||
274 | $ hg -R a parents --template "{node|short}\n" |
|
282 | $ hg -R a parents --template "{node|short}\n" | |
275 | e8ece76546a6 |
|
283 | e8ece76546a6 | |
276 | $ hg -R ua parents --template "{node|short}\n" |
|
284 | $ hg -R ua parents --template "{node|short}\n" | |
277 | e8ece76546a6 |
|
285 | e8ece76546a6 | |
278 |
|
286 | |||
279 | $ rm -r ua |
|
287 | $ rm -r ua | |
280 |
|
288 | |||
281 |
|
289 | |||
282 | Testing clone -u <branch>: |
|
290 | Testing clone -u <branch>: | |
283 |
|
291 | |||
284 | $ hg clone -u stable a ua |
|
292 | $ hg clone -u stable a ua | |
285 | updating to branch stable |
|
293 | updating to branch stable | |
286 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
294 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
287 |
|
295 | |||
288 | Repo ua has both heads: |
|
296 | Repo ua has both heads: | |
289 |
|
297 | |||
290 | $ hg -R ua heads |
|
298 | $ hg -R ua heads | |
291 | changeset: 15:0aae7cf88f0d |
|
299 | changeset: 15:0aae7cf88f0d | |
292 | branch: stable |
|
300 | branch: stable | |
293 | tag: tip |
|
301 | tag: tip | |
294 | user: test |
|
302 | user: test | |
295 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
303 | date: Thu Jan 01 00:00:00 1970 +0000 | |
296 | summary: another change for branch stable |
|
304 | summary: another change for branch stable | |
297 |
|
305 | |||
298 | changeset: 12:f21241060d6a |
|
306 | changeset: 12:f21241060d6a | |
299 | user: test |
|
307 | user: test | |
300 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
308 | date: Thu Jan 01 00:00:00 1970 +0000 | |
301 | summary: hacked default |
|
309 | summary: hacked default | |
302 |
|
310 | |||
303 |
|
311 | |||
304 | Branch 'stable' is checked out: |
|
312 | Branch 'stable' is checked out: | |
305 |
|
313 | |||
306 | $ hg -R ua parents |
|
314 | $ hg -R ua parents | |
307 | changeset: 15:0aae7cf88f0d |
|
315 | changeset: 15:0aae7cf88f0d | |
308 | branch: stable |
|
316 | branch: stable | |
309 | tag: tip |
|
317 | tag: tip | |
310 | user: test |
|
318 | user: test | |
311 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
319 | date: Thu Jan 01 00:00:00 1970 +0000 | |
312 | summary: another change for branch stable |
|
320 | summary: another change for branch stable | |
313 |
|
321 | |||
314 |
|
322 | |||
315 | $ rm -r ua |
|
323 | $ rm -r ua | |
316 |
|
324 | |||
317 |
|
325 | |||
318 | Testing default checkout: |
|
326 | Testing default checkout: | |
319 |
|
327 | |||
320 | $ hg clone a ua |
|
328 | $ hg clone a ua | |
321 | updating to branch default |
|
329 | updating to branch default | |
322 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
330 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
323 |
|
331 | |||
324 | Repo ua has both heads: |
|
332 | Repo ua has both heads: | |
325 |
|
333 | |||
326 | $ hg -R ua heads |
|
334 | $ hg -R ua heads | |
327 | changeset: 15:0aae7cf88f0d |
|
335 | changeset: 15:0aae7cf88f0d | |
328 | branch: stable |
|
336 | branch: stable | |
329 | tag: tip |
|
337 | tag: tip | |
330 | user: test |
|
338 | user: test | |
331 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
339 | date: Thu Jan 01 00:00:00 1970 +0000 | |
332 | summary: another change for branch stable |
|
340 | summary: another change for branch stable | |
333 |
|
341 | |||
334 | changeset: 12:f21241060d6a |
|
342 | changeset: 12:f21241060d6a | |
335 | user: test |
|
343 | user: test | |
336 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
344 | date: Thu Jan 01 00:00:00 1970 +0000 | |
337 | summary: hacked default |
|
345 | summary: hacked default | |
338 |
|
346 | |||
339 |
|
347 | |||
340 | Branch 'default' is checked out: |
|
348 | Branch 'default' is checked out: | |
341 |
|
349 | |||
342 | $ hg -R ua parents |
|
350 | $ hg -R ua parents | |
343 | changeset: 12:f21241060d6a |
|
351 | changeset: 12:f21241060d6a | |
344 | user: test |
|
352 | user: test | |
345 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
353 | date: Thu Jan 01 00:00:00 1970 +0000 | |
346 | summary: hacked default |
|
354 | summary: hacked default | |
347 |
|
355 | |||
348 | Test clone with a branch named "@" (issue3677) |
|
356 | Test clone with a branch named "@" (issue3677) | |
349 |
|
357 | |||
350 | $ hg -R ua branch @ |
|
358 | $ hg -R ua branch @ | |
351 | marked working directory as branch @ |
|
359 | marked working directory as branch @ | |
352 | (branches are permanent and global, did you want a bookmark?) |
|
360 | (branches are permanent and global, did you want a bookmark?) | |
353 | $ hg -R ua commit -m 'created branch @' |
|
361 | $ hg -R ua commit -m 'created branch @' | |
354 | $ hg clone ua atbranch |
|
362 | $ hg clone ua atbranch | |
355 | updating to branch default |
|
363 | updating to branch default | |
356 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
364 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
357 | $ hg -R atbranch heads |
|
365 | $ hg -R atbranch heads | |
358 | changeset: 16:798b6d97153e |
|
366 | changeset: 16:798b6d97153e | |
359 | branch: @ |
|
367 | branch: @ | |
360 | tag: tip |
|
368 | tag: tip | |
361 | parent: 12:f21241060d6a |
|
369 | parent: 12:f21241060d6a | |
362 | user: test |
|
370 | user: test | |
363 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
371 | date: Thu Jan 01 00:00:00 1970 +0000 | |
364 | summary: created branch @ |
|
372 | summary: created branch @ | |
365 |
|
373 | |||
366 | changeset: 15:0aae7cf88f0d |
|
374 | changeset: 15:0aae7cf88f0d | |
367 | branch: stable |
|
375 | branch: stable | |
368 | user: test |
|
376 | user: test | |
369 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
377 | date: Thu Jan 01 00:00:00 1970 +0000 | |
370 | summary: another change for branch stable |
|
378 | summary: another change for branch stable | |
371 |
|
379 | |||
372 | changeset: 12:f21241060d6a |
|
380 | changeset: 12:f21241060d6a | |
373 | user: test |
|
381 | user: test | |
374 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
382 | date: Thu Jan 01 00:00:00 1970 +0000 | |
375 | summary: hacked default |
|
383 | summary: hacked default | |
376 |
|
384 | |||
377 | $ hg -R atbranch parents |
|
385 | $ hg -R atbranch parents | |
378 | changeset: 12:f21241060d6a |
|
386 | changeset: 12:f21241060d6a | |
379 | user: test |
|
387 | user: test | |
380 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
388 | date: Thu Jan 01 00:00:00 1970 +0000 | |
381 | summary: hacked default |
|
389 | summary: hacked default | |
382 |
|
390 | |||
383 |
|
391 | |||
384 | $ rm -r ua atbranch |
|
392 | $ rm -r ua atbranch | |
385 |
|
393 | |||
386 |
|
394 | |||
387 | Testing #<branch>: |
|
395 | Testing #<branch>: | |
388 |
|
396 | |||
389 | $ hg clone -u . a#stable ua |
|
397 | $ hg clone -u . a#stable ua | |
390 | adding changesets |
|
398 | adding changesets | |
391 | adding manifests |
|
399 | adding manifests | |
392 | adding file changes |
|
400 | adding file changes | |
393 | added 14 changesets with 14 changes to 3 files |
|
401 | added 14 changesets with 14 changes to 3 files | |
394 | updating to branch stable |
|
402 | updating to branch stable | |
395 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
403 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
396 |
|
404 | |||
397 | Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6): |
|
405 | Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6): | |
398 |
|
406 | |||
399 | $ hg -R ua heads |
|
407 | $ hg -R ua heads | |
400 | changeset: 13:0aae7cf88f0d |
|
408 | changeset: 13:0aae7cf88f0d | |
401 | branch: stable |
|
409 | branch: stable | |
402 | tag: tip |
|
410 | tag: tip | |
403 | user: test |
|
411 | user: test | |
404 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
412 | date: Thu Jan 01 00:00:00 1970 +0000 | |
405 | summary: another change for branch stable |
|
413 | summary: another change for branch stable | |
406 |
|
414 | |||
407 | changeset: 10:a7949464abda |
|
415 | changeset: 10:a7949464abda | |
408 | user: test |
|
416 | user: test | |
409 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
417 | date: Thu Jan 01 00:00:00 1970 +0000 | |
410 | summary: test |
|
418 | summary: test | |
411 |
|
419 | |||
412 |
|
420 | |||
413 | Same revision checked out in repo a and ua: |
|
421 | Same revision checked out in repo a and ua: | |
414 |
|
422 | |||
415 | $ hg -R a parents --template "{node|short}\n" |
|
423 | $ hg -R a parents --template "{node|short}\n" | |
416 | e8ece76546a6 |
|
424 | e8ece76546a6 | |
417 | $ hg -R ua parents --template "{node|short}\n" |
|
425 | $ hg -R ua parents --template "{node|short}\n" | |
418 | e8ece76546a6 |
|
426 | e8ece76546a6 | |
419 |
|
427 | |||
420 | $ rm -r ua |
|
428 | $ rm -r ua | |
421 |
|
429 | |||
422 |
|
430 | |||
423 | Testing -u -r <branch>: |
|
431 | Testing -u -r <branch>: | |
424 |
|
432 | |||
425 | $ hg clone -u . -r stable a ua |
|
433 | $ hg clone -u . -r stable a ua | |
426 | adding changesets |
|
434 | adding changesets | |
427 | adding manifests |
|
435 | adding manifests | |
428 | adding file changes |
|
436 | adding file changes | |
429 | added 14 changesets with 14 changes to 3 files |
|
437 | added 14 changesets with 14 changes to 3 files | |
430 | updating to branch stable |
|
438 | updating to branch stable | |
431 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
439 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
432 |
|
440 | |||
433 | Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6): |
|
441 | Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6): | |
434 |
|
442 | |||
435 | $ hg -R ua heads |
|
443 | $ hg -R ua heads | |
436 | changeset: 13:0aae7cf88f0d |
|
444 | changeset: 13:0aae7cf88f0d | |
437 | branch: stable |
|
445 | branch: stable | |
438 | tag: tip |
|
446 | tag: tip | |
439 | user: test |
|
447 | user: test | |
440 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
448 | date: Thu Jan 01 00:00:00 1970 +0000 | |
441 | summary: another change for branch stable |
|
449 | summary: another change for branch stable | |
442 |
|
450 | |||
443 | changeset: 10:a7949464abda |
|
451 | changeset: 10:a7949464abda | |
444 | user: test |
|
452 | user: test | |
445 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
453 | date: Thu Jan 01 00:00:00 1970 +0000 | |
446 | summary: test |
|
454 | summary: test | |
447 |
|
455 | |||
448 |
|
456 | |||
449 | Same revision checked out in repo a and ua: |
|
457 | Same revision checked out in repo a and ua: | |
450 |
|
458 | |||
451 | $ hg -R a parents --template "{node|short}\n" |
|
459 | $ hg -R a parents --template "{node|short}\n" | |
452 | e8ece76546a6 |
|
460 | e8ece76546a6 | |
453 | $ hg -R ua parents --template "{node|short}\n" |
|
461 | $ hg -R ua parents --template "{node|short}\n" | |
454 | e8ece76546a6 |
|
462 | e8ece76546a6 | |
455 |
|
463 | |||
456 | $ rm -r ua |
|
464 | $ rm -r ua | |
457 |
|
465 | |||
458 |
|
466 | |||
459 | Testing -r <branch>: |
|
467 | Testing -r <branch>: | |
460 |
|
468 | |||
461 | $ hg clone -r stable a ua |
|
469 | $ hg clone -r stable a ua | |
462 | adding changesets |
|
470 | adding changesets | |
463 | adding manifests |
|
471 | adding manifests | |
464 | adding file changes |
|
472 | adding file changes | |
465 | added 14 changesets with 14 changes to 3 files |
|
473 | added 14 changesets with 14 changes to 3 files | |
466 | updating to branch stable |
|
474 | updating to branch stable | |
467 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
475 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
468 |
|
476 | |||
469 | Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6): |
|
477 | Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6): | |
470 |
|
478 | |||
471 | $ hg -R ua heads |
|
479 | $ hg -R ua heads | |
472 | changeset: 13:0aae7cf88f0d |
|
480 | changeset: 13:0aae7cf88f0d | |
473 | branch: stable |
|
481 | branch: stable | |
474 | tag: tip |
|
482 | tag: tip | |
475 | user: test |
|
483 | user: test | |
476 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
484 | date: Thu Jan 01 00:00:00 1970 +0000 | |
477 | summary: another change for branch stable |
|
485 | summary: another change for branch stable | |
478 |
|
486 | |||
479 | changeset: 10:a7949464abda |
|
487 | changeset: 10:a7949464abda | |
480 | user: test |
|
488 | user: test | |
481 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
489 | date: Thu Jan 01 00:00:00 1970 +0000 | |
482 | summary: test |
|
490 | summary: test | |
483 |
|
491 | |||
484 |
|
492 | |||
485 | Branch 'stable' is checked out: |
|
493 | Branch 'stable' is checked out: | |
486 |
|
494 | |||
487 | $ hg -R ua parents |
|
495 | $ hg -R ua parents | |
488 | changeset: 13:0aae7cf88f0d |
|
496 | changeset: 13:0aae7cf88f0d | |
489 | branch: stable |
|
497 | branch: stable | |
490 | tag: tip |
|
498 | tag: tip | |
491 | user: test |
|
499 | user: test | |
492 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
500 | date: Thu Jan 01 00:00:00 1970 +0000 | |
493 | summary: another change for branch stable |
|
501 | summary: another change for branch stable | |
494 |
|
502 | |||
495 |
|
503 | |||
496 | $ rm -r ua |
|
504 | $ rm -r ua | |
497 |
|
505 | |||
498 |
|
506 | |||
499 | Issue2267: Error in 1.6 hg.py: TypeError: 'NoneType' object is not |
|
507 | Issue2267: Error in 1.6 hg.py: TypeError: 'NoneType' object is not | |
500 | iterable in addbranchrevs() |
|
508 | iterable in addbranchrevs() | |
501 |
|
509 | |||
502 | $ cat <<EOF > simpleclone.py |
|
510 | $ cat <<EOF > simpleclone.py | |
503 | > from mercurial import ui, hg |
|
511 | > from mercurial import ui, hg | |
504 | > myui = ui.ui() |
|
512 | > myui = ui.ui() | |
505 | > repo = hg.repository(myui, 'a') |
|
513 | > repo = hg.repository(myui, 'a') | |
506 | > hg.clone(myui, {}, repo, dest="ua") |
|
514 | > hg.clone(myui, {}, repo, dest="ua") | |
507 | > EOF |
|
515 | > EOF | |
508 |
|
516 | |||
509 | $ python simpleclone.py |
|
517 | $ python simpleclone.py | |
510 | updating to branch default |
|
518 | updating to branch default | |
511 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
519 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
512 |
|
520 | |||
513 | $ rm -r ua |
|
521 | $ rm -r ua | |
514 |
|
522 | |||
515 | $ cat <<EOF > branchclone.py |
|
523 | $ cat <<EOF > branchclone.py | |
516 | > from mercurial import ui, hg, extensions |
|
524 | > from mercurial import ui, hg, extensions | |
517 | > myui = ui.ui() |
|
525 | > myui = ui.ui() | |
518 | > extensions.loadall(myui) |
|
526 | > extensions.loadall(myui) | |
519 | > repo = hg.repository(myui, 'a') |
|
527 | > repo = hg.repository(myui, 'a') | |
520 | > hg.clone(myui, {}, repo, dest="ua", branch=["stable",]) |
|
528 | > hg.clone(myui, {}, repo, dest="ua", branch=["stable",]) | |
521 | > EOF |
|
529 | > EOF | |
522 |
|
530 | |||
523 | $ python branchclone.py |
|
531 | $ python branchclone.py | |
524 | adding changesets |
|
532 | adding changesets | |
525 | adding manifests |
|
533 | adding manifests | |
526 | adding file changes |
|
534 | adding file changes | |
527 | added 14 changesets with 14 changes to 3 files |
|
535 | added 14 changesets with 14 changes to 3 files | |
528 | updating to branch stable |
|
536 | updating to branch stable | |
529 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
537 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
530 | $ rm -r ua |
|
538 | $ rm -r ua | |
531 |
|
539 | |||
532 |
|
540 | |||
533 | Test clone with special '@' bookmark: |
|
541 | Test clone with special '@' bookmark: | |
534 | $ cd a |
|
542 | $ cd a | |
535 | $ hg bookmark -r a7949464abda @ # branch point of stable from default |
|
543 | $ hg bookmark -r a7949464abda @ # branch point of stable from default | |
536 | $ hg clone . ../i |
|
544 | $ hg clone . ../i | |
537 | updating to bookmark @ |
|
545 | updating to bookmark @ | |
538 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
546 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
539 | $ hg id -i ../i |
|
547 | $ hg id -i ../i | |
540 | a7949464abda |
|
548 | a7949464abda | |
541 | $ rm -r ../i |
|
549 | $ rm -r ../i | |
542 |
|
550 | |||
543 | $ hg bookmark -f -r stable @ |
|
551 | $ hg bookmark -f -r stable @ | |
544 | $ hg bookmarks |
|
552 | $ hg bookmarks | |
545 | @ 15:0aae7cf88f0d |
|
553 | @ 15:0aae7cf88f0d | |
546 | $ hg clone . ../i |
|
554 | $ hg clone . ../i | |
547 | updating to bookmark @ on branch stable |
|
555 | updating to bookmark @ on branch stable | |
548 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
556 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
549 | $ hg id -i ../i |
|
557 | $ hg id -i ../i | |
550 | 0aae7cf88f0d |
|
558 | 0aae7cf88f0d | |
551 | $ cd "$TESTTMP" |
|
559 | $ cd "$TESTTMP" | |
552 |
|
560 | |||
553 |
|
561 | |||
554 | Testing failures: |
|
562 | Testing failures: | |
555 |
|
563 | |||
556 | $ mkdir fail |
|
564 | $ mkdir fail | |
557 | $ cd fail |
|
565 | $ cd fail | |
558 |
|
566 | |||
559 | No local source |
|
567 | No local source | |
560 |
|
568 | |||
561 | $ hg clone a b |
|
569 | $ hg clone a b | |
562 | abort: repository a not found! |
|
570 | abort: repository a not found! | |
563 | [255] |
|
571 | [255] | |
564 |
|
572 | |||
565 | No remote source |
|
573 | No remote source | |
566 |
|
574 | |||
567 | #if windows |
|
575 | #if windows | |
568 | $ hg clone http://127.0.0.1:3121/a b |
|
576 | $ hg clone http://127.0.0.1:3121/a b | |
569 | abort: error: * (glob) |
|
577 | abort: error: * (glob) | |
570 | [255] |
|
578 | [255] | |
571 | #else |
|
579 | #else | |
572 | $ hg clone http://127.0.0.1:3121/a b |
|
580 | $ hg clone http://127.0.0.1:3121/a b | |
573 | abort: error: *refused* (glob) |
|
581 | abort: error: *refused* (glob) | |
574 | [255] |
|
582 | [255] | |
575 | #endif |
|
583 | #endif | |
576 | $ rm -rf b # work around bug with http clone |
|
584 | $ rm -rf b # work around bug with http clone | |
577 |
|
585 | |||
578 |
|
586 | |||
579 | #if unix-permissions no-root |
|
587 | #if unix-permissions no-root | |
580 |
|
588 | |||
581 | Inaccessible source |
|
589 | Inaccessible source | |
582 |
|
590 | |||
583 | $ mkdir a |
|
591 | $ mkdir a | |
584 | $ chmod 000 a |
|
592 | $ chmod 000 a | |
585 | $ hg clone a b |
|
593 | $ hg clone a b | |
586 | abort: repository a not found! |
|
594 | abort: repository a not found! | |
587 | [255] |
|
595 | [255] | |
588 |
|
596 | |||
589 | Inaccessible destination |
|
597 | Inaccessible destination | |
590 |
|
598 | |||
591 | $ hg init b |
|
599 | $ hg init b | |
592 | $ cd b |
|
600 | $ cd b | |
593 | $ hg clone . ../a |
|
601 | $ hg clone . ../a | |
594 | abort: Permission denied: '../a' |
|
602 | abort: Permission denied: '../a' | |
595 | [255] |
|
603 | [255] | |
596 | $ cd .. |
|
604 | $ cd .. | |
597 | $ chmod 700 a |
|
605 | $ chmod 700 a | |
598 | $ rm -r a b |
|
606 | $ rm -r a b | |
599 |
|
607 | |||
600 | #endif |
|
608 | #endif | |
601 |
|
609 | |||
602 |
|
610 | |||
603 | #if fifo |
|
611 | #if fifo | |
604 |
|
612 | |||
605 | Source of wrong type |
|
613 | Source of wrong type | |
606 |
|
614 | |||
607 | $ mkfifo a |
|
615 | $ mkfifo a | |
608 | $ hg clone a b |
|
616 | $ hg clone a b | |
609 | abort: repository a not found! |
|
617 | abort: repository a not found! | |
610 | [255] |
|
618 | [255] | |
611 | $ rm a |
|
619 | $ rm a | |
612 |
|
620 | |||
613 | #endif |
|
621 | #endif | |
614 |
|
622 | |||
615 | Default destination, same directory |
|
623 | Default destination, same directory | |
616 |
|
624 | |||
617 | $ hg init q |
|
625 | $ hg init q | |
618 | $ hg clone q |
|
626 | $ hg clone q | |
619 | destination directory: q |
|
627 | destination directory: q | |
620 | abort: destination 'q' is not empty |
|
628 | abort: destination 'q' is not empty | |
621 | [255] |
|
629 | [255] | |
622 |
|
630 | |||
623 | destination directory not empty |
|
631 | destination directory not empty | |
624 |
|
632 | |||
625 | $ mkdir a |
|
633 | $ mkdir a | |
626 | $ echo stuff > a/a |
|
634 | $ echo stuff > a/a | |
627 | $ hg clone q a |
|
635 | $ hg clone q a | |
628 | abort: destination 'a' is not empty |
|
636 | abort: destination 'a' is not empty | |
629 | [255] |
|
637 | [255] | |
630 |
|
638 | |||
631 |
|
639 | |||
632 | #if unix-permissions no-root |
|
640 | #if unix-permissions no-root | |
633 |
|
641 | |||
634 | leave existing directory in place after clone failure |
|
642 | leave existing directory in place after clone failure | |
635 |
|
643 | |||
636 | $ hg init c |
|
644 | $ hg init c | |
637 | $ cd c |
|
645 | $ cd c | |
638 | $ echo c > c |
|
646 | $ echo c > c | |
639 | $ hg commit -A -m test |
|
647 | $ hg commit -A -m test | |
640 | adding c |
|
648 | adding c | |
641 | $ chmod -rx .hg/store/data |
|
649 | $ chmod -rx .hg/store/data | |
642 | $ cd .. |
|
650 | $ cd .. | |
643 | $ mkdir d |
|
651 | $ mkdir d | |
644 | $ hg clone c d 2> err |
|
652 | $ hg clone c d 2> err | |
645 | [255] |
|
653 | [255] | |
646 | $ test -d d |
|
654 | $ test -d d | |
647 | $ test -d d/.hg |
|
655 | $ test -d d/.hg | |
648 | [1] |
|
656 | [1] | |
649 |
|
657 | |||
650 | re-enable perm to allow deletion |
|
658 | re-enable perm to allow deletion | |
651 |
|
659 | |||
652 | $ chmod +rx c/.hg/store/data |
|
660 | $ chmod +rx c/.hg/store/data | |
653 |
|
661 | |||
654 | #endif |
|
662 | #endif | |
655 |
|
663 | |||
656 | $ cd .. |
|
664 | $ cd .. | |
657 |
|
665 | |||
658 | Test clone from the repository in (emulated) revlog format 0 (issue4203): |
|
666 | Test clone from the repository in (emulated) revlog format 0 (issue4203): | |
659 |
|
667 | |||
660 | $ mkdir issue4203 |
|
668 | $ mkdir issue4203 | |
661 | $ mkdir -p src/.hg |
|
669 | $ mkdir -p src/.hg | |
662 | $ echo foo > src/foo |
|
670 | $ echo foo > src/foo | |
663 | $ hg -R src add src/foo |
|
671 | $ hg -R src add src/foo | |
664 | $ hg -R src commit -m '#0' |
|
672 | $ hg -R src commit -m '#0' | |
665 | $ hg -R src log -q |
|
673 | $ hg -R src log -q | |
666 | 0:e1bab28bca43 |
|
674 | 0:e1bab28bca43 | |
667 | $ hg clone -U -q src dst |
|
675 | $ hg clone -U -q src dst | |
668 | $ hg -R dst log -q |
|
676 | $ hg -R dst log -q | |
669 | 0:e1bab28bca43 |
|
677 | 0:e1bab28bca43 | |
670 | $ cd .. |
|
678 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now