##// END OF EJS Templates
tests: demonstrate failure when cloning from a share via bundle2...
mitchell plamann -
r41957:a62ad1be default
parent child Browse files
Show More
@@ -1,472 +1,482 b''
1 $ echo "[extensions]" >> $HGRCPATH
1 $ echo "[extensions]" >> $HGRCPATH
2 $ echo "share = " >> $HGRCPATH
2 $ echo "share = " >> $HGRCPATH
3
3
4 prepare repo1
4 prepare repo1
5
5
6 $ hg init repo1
6 $ hg init repo1
7 $ cd repo1
7 $ cd repo1
8 $ echo a > a
8 $ echo a > a
9 $ hg commit -A -m'init'
9 $ hg commit -A -m'init'
10 adding a
10 adding a
11
11
12 share it
12 share it
13
13
14 $ cd ..
14 $ cd ..
15 $ hg share repo1 repo2
15 $ hg share repo1 repo2
16 updating working directory
16 updating working directory
17 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
17 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
18
18
19 share shouldn't have a store dir
19 share shouldn't have a store dir
20
20
21 $ cd repo2
21 $ cd repo2
22 $ test -d .hg/store
22 $ test -d .hg/store
23 [1]
23 [1]
24
24
25 share shouldn't have a full cache dir, original repo should
25 share shouldn't have a full cache dir, original repo should
26
26
27 $ hg branches
27 $ hg branches
28 default 0:d3873e73d99e
28 default 0:d3873e73d99e
29 $ hg tags
29 $ hg tags
30 tip 0:d3873e73d99e
30 tip 0:d3873e73d99e
31 $ test -d .hg/cache
31 $ test -d .hg/cache
32 [1]
32 [1]
33 $ ls -1 .hg/wcache || true
33 $ ls -1 .hg/wcache || true
34 checkisexec (execbit !)
34 checkisexec (execbit !)
35 checklink (symlink !)
35 checklink (symlink !)
36 checklink-target (symlink !)
36 checklink-target (symlink !)
37 $ ls -1 ../repo1/.hg/cache
37 $ ls -1 ../repo1/.hg/cache
38 branch2-served
38 branch2-served
39 manifestfulltextcache (reporevlogstore !)
39 manifestfulltextcache (reporevlogstore !)
40 rbc-names-v1
40 rbc-names-v1
41 rbc-revs-v1
41 rbc-revs-v1
42 tags2-visible
42 tags2-visible
43
43
44 Some sed versions appends newline, some don't, and some just fails
44 Some sed versions appends newline, some don't, and some just fails
45
45
46 $ cat .hg/sharedpath; echo
46 $ cat .hg/sharedpath; echo
47 $TESTTMP/repo1/.hg
47 $TESTTMP/repo1/.hg
48
48
49 trailing newline on .hg/sharedpath is ok
49 trailing newline on .hg/sharedpath is ok
50 $ hg tip -q
50 $ hg tip -q
51 0:d3873e73d99e
51 0:d3873e73d99e
52 $ echo '' >> .hg/sharedpath
52 $ echo '' >> .hg/sharedpath
53 $ cat .hg/sharedpath
53 $ cat .hg/sharedpath
54 $TESTTMP/repo1/.hg
54 $TESTTMP/repo1/.hg
55 $ hg tip -q
55 $ hg tip -q
56 0:d3873e73d99e
56 0:d3873e73d99e
57
57
58 commit in shared clone
58 commit in shared clone
59
59
60 $ echo a >> a
60 $ echo a >> a
61 $ hg commit -m'change in shared clone'
61 $ hg commit -m'change in shared clone'
62
62
63 check original
63 check original
64
64
65 $ cd ../repo1
65 $ cd ../repo1
66 $ hg log
66 $ hg log
67 changeset: 1:8af4dc49db9e
67 changeset: 1:8af4dc49db9e
68 tag: tip
68 tag: tip
69 user: test
69 user: test
70 date: Thu Jan 01 00:00:00 1970 +0000
70 date: Thu Jan 01 00:00:00 1970 +0000
71 summary: change in shared clone
71 summary: change in shared clone
72
72
73 changeset: 0:d3873e73d99e
73 changeset: 0:d3873e73d99e
74 user: test
74 user: test
75 date: Thu Jan 01 00:00:00 1970 +0000
75 date: Thu Jan 01 00:00:00 1970 +0000
76 summary: init
76 summary: init
77
77
78 $ hg update
78 $ hg update
79 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
79 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
80 $ cat a # should be two lines of "a"
80 $ cat a # should be two lines of "a"
81 a
81 a
82 a
82 a
83
83
84 commit in original
84 commit in original
85
85
86 $ echo b > b
86 $ echo b > b
87 $ hg commit -A -m'another file'
87 $ hg commit -A -m'another file'
88 adding b
88 adding b
89
89
90 check in shared clone
90 check in shared clone
91
91
92 $ cd ../repo2
92 $ cd ../repo2
93 $ hg log
93 $ hg log
94 changeset: 2:c2e0ac586386
94 changeset: 2:c2e0ac586386
95 tag: tip
95 tag: tip
96 user: test
96 user: test
97 date: Thu Jan 01 00:00:00 1970 +0000
97 date: Thu Jan 01 00:00:00 1970 +0000
98 summary: another file
98 summary: another file
99
99
100 changeset: 1:8af4dc49db9e
100 changeset: 1:8af4dc49db9e
101 user: test
101 user: test
102 date: Thu Jan 01 00:00:00 1970 +0000
102 date: Thu Jan 01 00:00:00 1970 +0000
103 summary: change in shared clone
103 summary: change in shared clone
104
104
105 changeset: 0:d3873e73d99e
105 changeset: 0:d3873e73d99e
106 user: test
106 user: test
107 date: Thu Jan 01 00:00:00 1970 +0000
107 date: Thu Jan 01 00:00:00 1970 +0000
108 summary: init
108 summary: init
109
109
110 $ hg update
110 $ hg update
111 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
111 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
112 $ cat b # should exist with one "b"
112 $ cat b # should exist with one "b"
113 b
113 b
114
114
115 hg serve shared clone
115 hg serve shared clone
116
116
117 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid
117 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid
118 $ cat hg.pid >> $DAEMON_PIDS
118 $ cat hg.pid >> $DAEMON_PIDS
119 $ get-with-headers.py localhost:$HGPORT 'raw-file/'
119 $ get-with-headers.py localhost:$HGPORT 'raw-file/'
120 200 Script output follows
120 200 Script output follows
121
121
122
122
123 -rw-r--r-- 4 a
123 -rw-r--r-- 4 a
124 -rw-r--r-- 2 b
124 -rw-r--r-- 2 b
125
125
126
126
127 Cloning a shared repo via bundle2 wrongly adds "shared" to the clone's requirements
128
129 $ cd ..
130 $ hg clone -q --stream --config ui.ssh="$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/`pwd`/repo2 cloned-via-bundle2
131 $ cat ./cloned-via-bundle2/.hg/requires | grep "shared"
132 shared
133 $ hg id --cwd cloned-via-bundle2 -r tip
134 abort: $ENOENT$: '$TESTTMP/cloned-via-bundle2/.hg/sharedpath'
135 [255]
136 $ cd repo2
127
137
128 test unshare command
138 test unshare command
129
139
130 $ hg unshare
140 $ hg unshare
131 $ test -d .hg/store
141 $ test -d .hg/store
132 $ test -f .hg/sharedpath
142 $ test -f .hg/sharedpath
133 [1]
143 [1]
134 $ grep shared .hg/requires
144 $ grep shared .hg/requires
135 [1]
145 [1]
136 $ hg unshare
146 $ hg unshare
137 abort: this is not a shared repo
147 abort: this is not a shared repo
138 [255]
148 [255]
139
149
140 check that a change does not propagate
150 check that a change does not propagate
141
151
142 $ echo b >> b
152 $ echo b >> b
143 $ hg commit -m'change in unshared'
153 $ hg commit -m'change in unshared'
144 $ cd ../repo1
154 $ cd ../repo1
145 $ hg id -r tip
155 $ hg id -r tip
146 c2e0ac586386 tip
156 c2e0ac586386 tip
147
157
148 $ cd ..
158 $ cd ..
149
159
150
160
151 test sharing bookmarks
161 test sharing bookmarks
152
162
153 $ hg share -B repo1 repo3
163 $ hg share -B repo1 repo3
154 updating working directory
164 updating working directory
155 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
165 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
156 $ cd repo1
166 $ cd repo1
157 $ hg bookmark bm1
167 $ hg bookmark bm1
158 $ hg bookmarks
168 $ hg bookmarks
159 * bm1 2:c2e0ac586386
169 * bm1 2:c2e0ac586386
160 $ cd ../repo2
170 $ cd ../repo2
161 $ hg book bm2
171 $ hg book bm2
162 $ hg bookmarks
172 $ hg bookmarks
163 * bm2 3:0e6e70d1d5f1
173 * bm2 3:0e6e70d1d5f1
164 $ cd ../repo3
174 $ cd ../repo3
165 $ hg bookmarks
175 $ hg bookmarks
166 bm1 2:c2e0ac586386
176 bm1 2:c2e0ac586386
167 $ hg book bm3
177 $ hg book bm3
168 $ hg bookmarks
178 $ hg bookmarks
169 bm1 2:c2e0ac586386
179 bm1 2:c2e0ac586386
170 * bm3 2:c2e0ac586386
180 * bm3 2:c2e0ac586386
171 $ cd ../repo1
181 $ cd ../repo1
172 $ hg bookmarks
182 $ hg bookmarks
173 * bm1 2:c2e0ac586386
183 * bm1 2:c2e0ac586386
174 bm3 2:c2e0ac586386
184 bm3 2:c2e0ac586386
175
185
176 check whether HG_PENDING makes pending changes only in relatd
186 check whether HG_PENDING makes pending changes only in relatd
177 repositories visible to an external hook.
187 repositories visible to an external hook.
178
188
179 In "hg share" case, another transaction can't run in other
189 In "hg share" case, another transaction can't run in other
180 repositories sharing same source repository, because starting
190 repositories sharing same source repository, because starting
181 transaction requires locking store of source repository.
191 transaction requires locking store of source repository.
182
192
183 Therefore, this test scenario ignores checking visibility of
193 Therefore, this test scenario ignores checking visibility of
184 .hg/bookmakrs.pending in repo2, which shares repo1 without bookmarks.
194 .hg/bookmakrs.pending in repo2, which shares repo1 without bookmarks.
185
195
186 $ cat > $TESTTMP/checkbookmarks.sh <<EOF
196 $ cat > $TESTTMP/checkbookmarks.sh <<EOF
187 > echo "@repo1"
197 > echo "@repo1"
188 > hg -R "$TESTTMP/repo1" bookmarks
198 > hg -R "$TESTTMP/repo1" bookmarks
189 > echo "@repo2"
199 > echo "@repo2"
190 > hg -R "$TESTTMP/repo2" bookmarks
200 > hg -R "$TESTTMP/repo2" bookmarks
191 > echo "@repo3"
201 > echo "@repo3"
192 > hg -R "$TESTTMP/repo3" bookmarks
202 > hg -R "$TESTTMP/repo3" bookmarks
193 > exit 1 # to avoid adding new bookmark for subsequent tests
203 > exit 1 # to avoid adding new bookmark for subsequent tests
194 > EOF
204 > EOF
195
205
196 $ cd ../repo1
206 $ cd ../repo1
197 $ hg --config hooks.pretxnclose="sh $TESTTMP/checkbookmarks.sh" -q book bmX
207 $ hg --config hooks.pretxnclose="sh $TESTTMP/checkbookmarks.sh" -q book bmX
198 @repo1
208 @repo1
199 bm1 2:c2e0ac586386
209 bm1 2:c2e0ac586386
200 bm3 2:c2e0ac586386
210 bm3 2:c2e0ac586386
201 * bmX 2:c2e0ac586386
211 * bmX 2:c2e0ac586386
202 @repo2
212 @repo2
203 * bm2 3:0e6e70d1d5f1
213 * bm2 3:0e6e70d1d5f1
204 @repo3
214 @repo3
205 bm1 2:c2e0ac586386
215 bm1 2:c2e0ac586386
206 * bm3 2:c2e0ac586386
216 * bm3 2:c2e0ac586386
207 bmX 2:c2e0ac586386
217 bmX 2:c2e0ac586386
208 transaction abort!
218 transaction abort!
209 rollback completed
219 rollback completed
210 abort: pretxnclose hook exited with status 1
220 abort: pretxnclose hook exited with status 1
211 [255]
221 [255]
212 $ hg book bm1
222 $ hg book bm1
213
223
214 FYI, in contrast to above test, bmX is invisible in repo1 (= shared
224 FYI, in contrast to above test, bmX is invisible in repo1 (= shared
215 src), because (1) HG_PENDING refers only repo3 and (2)
225 src), because (1) HG_PENDING refers only repo3 and (2)
216 "bookmarks.pending" is written only into repo3.
226 "bookmarks.pending" is written only into repo3.
217
227
218 $ cd ../repo3
228 $ cd ../repo3
219 $ hg --config hooks.pretxnclose="sh $TESTTMP/checkbookmarks.sh" -q book bmX
229 $ hg --config hooks.pretxnclose="sh $TESTTMP/checkbookmarks.sh" -q book bmX
220 @repo1
230 @repo1
221 * bm1 2:c2e0ac586386
231 * bm1 2:c2e0ac586386
222 bm3 2:c2e0ac586386
232 bm3 2:c2e0ac586386
223 @repo2
233 @repo2
224 * bm2 3:0e6e70d1d5f1
234 * bm2 3:0e6e70d1d5f1
225 @repo3
235 @repo3
226 bm1 2:c2e0ac586386
236 bm1 2:c2e0ac586386
227 bm3 2:c2e0ac586386
237 bm3 2:c2e0ac586386
228 * bmX 2:c2e0ac586386
238 * bmX 2:c2e0ac586386
229 transaction abort!
239 transaction abort!
230 rollback completed
240 rollback completed
231 abort: pretxnclose hook exited with status 1
241 abort: pretxnclose hook exited with status 1
232 [255]
242 [255]
233 $ hg book bm3
243 $ hg book bm3
234
244
235 $ cd ../repo1
245 $ cd ../repo1
236
246
237 test that commits work
247 test that commits work
238
248
239 $ echo 'shared bookmarks' > a
249 $ echo 'shared bookmarks' > a
240 $ hg commit -m 'testing shared bookmarks'
250 $ hg commit -m 'testing shared bookmarks'
241 $ hg bookmarks
251 $ hg bookmarks
242 * bm1 3:b87954705719
252 * bm1 3:b87954705719
243 bm3 2:c2e0ac586386
253 bm3 2:c2e0ac586386
244 $ cd ../repo3
254 $ cd ../repo3
245 $ hg bookmarks
255 $ hg bookmarks
246 bm1 3:b87954705719
256 bm1 3:b87954705719
247 * bm3 2:c2e0ac586386
257 * bm3 2:c2e0ac586386
248 $ echo 'more shared bookmarks' > a
258 $ echo 'more shared bookmarks' > a
249 $ hg commit -m 'testing shared bookmarks'
259 $ hg commit -m 'testing shared bookmarks'
250 created new head
260 created new head
251 $ hg bookmarks
261 $ hg bookmarks
252 bm1 3:b87954705719
262 bm1 3:b87954705719
253 * bm3 4:62f4ded848e4
263 * bm3 4:62f4ded848e4
254 $ cd ../repo1
264 $ cd ../repo1
255 $ hg bookmarks
265 $ hg bookmarks
256 * bm1 3:b87954705719
266 * bm1 3:b87954705719
257 bm3 4:62f4ded848e4
267 bm3 4:62f4ded848e4
258 $ cd ..
268 $ cd ..
259
269
260 non largefiles repos won't enable largefiles
270 non largefiles repos won't enable largefiles
261
271
262 $ hg share --config extensions.largefiles= repo3 sharedrepo
272 $ hg share --config extensions.largefiles= repo3 sharedrepo
263 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
273 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
264 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
274 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
265 updating working directory
275 updating working directory
266 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
276 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
267 $ [ -f sharedrepo/.hg/hgrc ]
277 $ [ -f sharedrepo/.hg/hgrc ]
268 [1]
278 [1]
269
279
270 test pushing bookmarks works
280 test pushing bookmarks works
271
281
272 $ hg clone repo3 repo4
282 $ hg clone repo3 repo4
273 updating to branch default
283 updating to branch default
274 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
284 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
275 $ cd repo4
285 $ cd repo4
276 $ hg boo bm4
286 $ hg boo bm4
277 $ echo foo > b
287 $ echo foo > b
278 $ hg commit -m 'foo in b'
288 $ hg commit -m 'foo in b'
279 $ hg boo
289 $ hg boo
280 bm1 3:b87954705719
290 bm1 3:b87954705719
281 bm3 4:62f4ded848e4
291 bm3 4:62f4ded848e4
282 * bm4 5:92793bfc8cad
292 * bm4 5:92793bfc8cad
283 $ hg push -B bm4
293 $ hg push -B bm4
284 pushing to $TESTTMP/repo3
294 pushing to $TESTTMP/repo3
285 searching for changes
295 searching for changes
286 adding changesets
296 adding changesets
287 adding manifests
297 adding manifests
288 adding file changes
298 adding file changes
289 added 1 changesets with 1 changes to 1 files
299 added 1 changesets with 1 changes to 1 files
290 exporting bookmark bm4
300 exporting bookmark bm4
291 $ cd ../repo1
301 $ cd ../repo1
292 $ hg bookmarks
302 $ hg bookmarks
293 * bm1 3:b87954705719
303 * bm1 3:b87954705719
294 bm3 4:62f4ded848e4
304 bm3 4:62f4ded848e4
295 bm4 5:92793bfc8cad
305 bm4 5:92793bfc8cad
296 $ cd ../repo3
306 $ cd ../repo3
297 $ hg bookmarks
307 $ hg bookmarks
298 bm1 3:b87954705719
308 bm1 3:b87954705719
299 * bm3 4:62f4ded848e4
309 * bm3 4:62f4ded848e4
300 bm4 5:92793bfc8cad
310 bm4 5:92793bfc8cad
301 $ cd ..
311 $ cd ..
302
312
303 test behavior when sharing a shared repo
313 test behavior when sharing a shared repo
304
314
305 $ hg share -B repo3 missingdir/repo5
315 $ hg share -B repo3 missingdir/repo5
306 updating working directory
316 updating working directory
307 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
317 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
308 $ cd missingdir/repo5
318 $ cd missingdir/repo5
309 $ hg book
319 $ hg book
310 bm1 3:b87954705719
320 bm1 3:b87954705719
311 bm3 4:62f4ded848e4
321 bm3 4:62f4ded848e4
312 bm4 5:92793bfc8cad
322 bm4 5:92793bfc8cad
313 $ cd ../..
323 $ cd ../..
314
324
315 test what happens when an active bookmark is deleted
325 test what happens when an active bookmark is deleted
316
326
317 $ cd repo1
327 $ cd repo1
318 $ hg boo -d bm3
328 $ hg boo -d bm3
319 $ hg boo
329 $ hg boo
320 * bm1 3:b87954705719
330 * bm1 3:b87954705719
321 bm4 5:92793bfc8cad
331 bm4 5:92793bfc8cad
322 $ cd ../repo3
332 $ cd ../repo3
323 $ hg boo
333 $ hg boo
324 bm1 3:b87954705719
334 bm1 3:b87954705719
325 bm4 5:92793bfc8cad
335 bm4 5:92793bfc8cad
326 $ cd ..
336 $ cd ..
327
337
328 verify that bookmarks are not written on failed transaction
338 verify that bookmarks are not written on failed transaction
329
339
330 $ cat > failpullbookmarks.py << EOF
340 $ cat > failpullbookmarks.py << EOF
331 > """A small extension that makes bookmark pulls fail, for testing"""
341 > """A small extension that makes bookmark pulls fail, for testing"""
332 > from __future__ import absolute_import
342 > from __future__ import absolute_import
333 > from mercurial import (
343 > from mercurial import (
334 > error,
344 > error,
335 > exchange,
345 > exchange,
336 > extensions,
346 > extensions,
337 > )
347 > )
338 > def _pullbookmarks(orig, pullop):
348 > def _pullbookmarks(orig, pullop):
339 > orig(pullop)
349 > orig(pullop)
340 > raise error.HookAbort('forced failure by extension')
350 > raise error.HookAbort('forced failure by extension')
341 > def extsetup(ui):
351 > def extsetup(ui):
342 > extensions.wrapfunction(exchange, '_pullbookmarks', _pullbookmarks)
352 > extensions.wrapfunction(exchange, '_pullbookmarks', _pullbookmarks)
343 > EOF
353 > EOF
344 $ cd repo4
354 $ cd repo4
345 $ hg boo
355 $ hg boo
346 bm1 3:b87954705719
356 bm1 3:b87954705719
347 bm3 4:62f4ded848e4
357 bm3 4:62f4ded848e4
348 * bm4 5:92793bfc8cad
358 * bm4 5:92793bfc8cad
349 $ cd ../repo3
359 $ cd ../repo3
350 $ hg boo
360 $ hg boo
351 bm1 3:b87954705719
361 bm1 3:b87954705719
352 bm4 5:92793bfc8cad
362 bm4 5:92793bfc8cad
353 $ hg --config "extensions.failpullbookmarks=$TESTTMP/failpullbookmarks.py" pull $TESTTMP/repo4
363 $ hg --config "extensions.failpullbookmarks=$TESTTMP/failpullbookmarks.py" pull $TESTTMP/repo4
354 pulling from $TESTTMP/repo4
364 pulling from $TESTTMP/repo4
355 searching for changes
365 searching for changes
356 no changes found
366 no changes found
357 adding remote bookmark bm3
367 adding remote bookmark bm3
358 abort: forced failure by extension
368 abort: forced failure by extension
359 [255]
369 [255]
360 $ hg boo
370 $ hg boo
361 bm1 3:b87954705719
371 bm1 3:b87954705719
362 bm4 5:92793bfc8cad
372 bm4 5:92793bfc8cad
363 $ hg pull $TESTTMP/repo4
373 $ hg pull $TESTTMP/repo4
364 pulling from $TESTTMP/repo4
374 pulling from $TESTTMP/repo4
365 searching for changes
375 searching for changes
366 no changes found
376 no changes found
367 adding remote bookmark bm3
377 adding remote bookmark bm3
368 1 local changesets published
378 1 local changesets published
369 $ hg boo
379 $ hg boo
370 bm1 3:b87954705719
380 bm1 3:b87954705719
371 * bm3 4:62f4ded848e4
381 * bm3 4:62f4ded848e4
372 bm4 5:92793bfc8cad
382 bm4 5:92793bfc8cad
373 $ cd ..
383 $ cd ..
374
384
375 verify bookmark behavior after unshare
385 verify bookmark behavior after unshare
376
386
377 $ cd repo3
387 $ cd repo3
378 $ hg unshare
388 $ hg unshare
379 $ hg boo
389 $ hg boo
380 bm1 3:b87954705719
390 bm1 3:b87954705719
381 * bm3 4:62f4ded848e4
391 * bm3 4:62f4ded848e4
382 bm4 5:92793bfc8cad
392 bm4 5:92793bfc8cad
383 $ hg boo -d bm4
393 $ hg boo -d bm4
384 $ hg boo bm5
394 $ hg boo bm5
385 $ hg boo
395 $ hg boo
386 bm1 3:b87954705719
396 bm1 3:b87954705719
387 bm3 4:62f4ded848e4
397 bm3 4:62f4ded848e4
388 * bm5 4:62f4ded848e4
398 * bm5 4:62f4ded848e4
389 $ cd ../repo1
399 $ cd ../repo1
390 $ hg boo
400 $ hg boo
391 * bm1 3:b87954705719
401 * bm1 3:b87954705719
392 bm3 4:62f4ded848e4
402 bm3 4:62f4ded848e4
393 bm4 5:92793bfc8cad
403 bm4 5:92793bfc8cad
394 $ cd ..
404 $ cd ..
395
405
396 test shared clones using relative paths work
406 test shared clones using relative paths work
397
407
398 $ mkdir thisdir
408 $ mkdir thisdir
399 $ hg init thisdir/orig
409 $ hg init thisdir/orig
400 $ hg share -U thisdir/orig thisdir/abs
410 $ hg share -U thisdir/orig thisdir/abs
401 $ hg share -U --relative thisdir/abs thisdir/rel
411 $ hg share -U --relative thisdir/abs thisdir/rel
402 $ cat thisdir/rel/.hg/sharedpath
412 $ cat thisdir/rel/.hg/sharedpath
403 ../../orig/.hg (no-eol)
413 ../../orig/.hg (no-eol)
404 $ grep shared thisdir/*/.hg/requires
414 $ grep shared thisdir/*/.hg/requires
405 thisdir/abs/.hg/requires:shared
415 thisdir/abs/.hg/requires:shared
406 thisdir/rel/.hg/requires:relshared
416 thisdir/rel/.hg/requires:relshared
407 thisdir/rel/.hg/requires:shared
417 thisdir/rel/.hg/requires:shared
408
418
409 test that relative shared paths aren't relative to $PWD
419 test that relative shared paths aren't relative to $PWD
410
420
411 $ cd thisdir
421 $ cd thisdir
412 $ hg -R rel root
422 $ hg -R rel root
413 $TESTTMP/thisdir/rel
423 $TESTTMP/thisdir/rel
414 $ cd ..
424 $ cd ..
415
425
416 now test that relative paths really are relative, survive across
426 now test that relative paths really are relative, survive across
417 renames and changes of PWD
427 renames and changes of PWD
418
428
419 $ hg -R thisdir/abs root
429 $ hg -R thisdir/abs root
420 $TESTTMP/thisdir/abs
430 $TESTTMP/thisdir/abs
421 $ hg -R thisdir/rel root
431 $ hg -R thisdir/rel root
422 $TESTTMP/thisdir/rel
432 $TESTTMP/thisdir/rel
423 $ mv thisdir thatdir
433 $ mv thisdir thatdir
424 $ hg -R thatdir/abs root
434 $ hg -R thatdir/abs root
425 abort: .hg/sharedpath points to nonexistent directory $TESTTMP/thisdir/orig/.hg!
435 abort: .hg/sharedpath points to nonexistent directory $TESTTMP/thisdir/orig/.hg!
426 [255]
436 [255]
427 $ hg -R thatdir/rel root
437 $ hg -R thatdir/rel root
428 $TESTTMP/thatdir/rel
438 $TESTTMP/thatdir/rel
429
439
430 test unshare relshared repo
440 test unshare relshared repo
431
441
432 $ cd thatdir/rel
442 $ cd thatdir/rel
433 $ hg unshare
443 $ hg unshare
434 $ test -d .hg/store
444 $ test -d .hg/store
435 $ test -f .hg/sharedpath
445 $ test -f .hg/sharedpath
436 [1]
446 [1]
437 $ grep shared .hg/requires
447 $ grep shared .hg/requires
438 [1]
448 [1]
439 $ hg unshare
449 $ hg unshare
440 abort: this is not a shared repo
450 abort: this is not a shared repo
441 [255]
451 [255]
442 $ cd ../..
452 $ cd ../..
443
453
444 $ rm -r thatdir
454 $ rm -r thatdir
445
455
446 Demonstrate buggy behavior around requirements validation
456 Demonstrate buggy behavior around requirements validation
447 See comment in localrepo.py:makelocalrepository() for more.
457 See comment in localrepo.py:makelocalrepository() for more.
448
458
449 $ hg init sharenewrequires
459 $ hg init sharenewrequires
450 $ hg share sharenewrequires shareoldrequires
460 $ hg share sharenewrequires shareoldrequires
451 updating working directory
461 updating working directory
452 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
462 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
453
463
454 $ cat >> sharenewrequires/.hg/requires << EOF
464 $ cat >> sharenewrequires/.hg/requires << EOF
455 > missing-requirement
465 > missing-requirement
456 > EOF
466 > EOF
457
467
458 We cannot open the repo with the unknown requirement
468 We cannot open the repo with the unknown requirement
459
469
460 $ hg -R sharenewrequires status
470 $ hg -R sharenewrequires status
461 abort: repository requires features unknown to this Mercurial: missing-requirement!
471 abort: repository requires features unknown to this Mercurial: missing-requirement!
462 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
472 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
463 [255]
473 [255]
464
474
465 BUG: we don't get the same error when opening the shared repo pointing to it
475 BUG: we don't get the same error when opening the shared repo pointing to it
466
476
467 $ hg -R shareoldrequires status
477 $ hg -R shareoldrequires status
468
478
469 Explicitly kill daemons to let the test exit on Windows
479 Explicitly kill daemons to let the test exit on Windows
470
480
471 $ killdaemons.py
481 $ killdaemons.py
472
482
General Comments 0
You need to be logged in to leave comments. Login now