Show More
@@ -982,7 +982,13 b' class hgsubrepo(abstractsubrepo):' | |||||
982 | if len(self._repo) == 0: |
|
982 | if len(self._repo) == 0: | |
983 | # use self._repo.vfs instead of self.wvfs to remove .hg only |
|
983 | # use self._repo.vfs instead of self.wvfs to remove .hg only | |
984 | self._repo.vfs.rmtree() |
|
984 | self._repo.vfs.rmtree() | |
985 | if parentrepo.shared(): |
|
985 | ||
|
986 | # A remote subrepo could be shared if there is a local copy | |||
|
987 | # relative to the parent's share source. But clone pooling doesn't | |||
|
988 | # assemble the repos in a tree, so that can't be consistently done. | |||
|
989 | # A simpler option is for the user to configure clone pooling, and | |||
|
990 | # work with that. | |||
|
991 | if parentrepo.shared() and hg.islocal(srcurl): | |||
986 | self.ui.status(_('sharing subrepo %s from %s\n') |
|
992 | self.ui.status(_('sharing subrepo %s from %s\n') | |
987 | % (subrelpath(self), srcurl)) |
|
993 | % (subrelpath(self), srcurl)) | |
988 | shared = hg.share(self._repo._subparent.baseui, |
|
994 | shared = hg.share(self._repo._subparent.baseui, |
@@ -307,9 +307,21 b' from there.' | |||||
307 | searching for changes |
|
307 | searching for changes | |
308 | no changes found |
|
308 | no changes found | |
309 | updating working directory |
|
309 | updating working directory | |
310 |
|
|
310 | cloning subrepo foo from http://localhost:$HGPORT/foo | |
311 | abort: can only share local repositories (in subrepository "foo") |
|
311 | requesting all changes | |
312 | [255] |
|
312 | adding changesets | |
|
313 | adding manifests | |||
|
314 | adding file changes | |||
|
315 | added 4 changesets with 7 changes to 3 files | |||
|
316 | new changesets af048e97ade2:65903cebad86 | |||
|
317 | cloning subrepo foo/bar from http://localhost:$HGPORT/foo/bar | |||
|
318 | requesting all changes | |||
|
319 | adding changesets | |||
|
320 | adding manifests | |||
|
321 | adding file changes | |||
|
322 | added 3 changesets with 3 changes to 1 files | |||
|
323 | new changesets 4904098473f9:31ecbdafd357 | |||
|
324 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
313 |
|
325 | |||
314 | $ cat access.log |
|
326 | $ cat access.log | |
315 | * "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
327 | * "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) | |
@@ -329,6 +341,11 b' from there.' | |||||
329 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D1326fa26d0c00d2146c63b56bb6a45149d7325ac x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) |
|
341 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D1326fa26d0c00d2146c63b56bb6a45149d7325ac x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) | |
330 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=1326fa26d0c00d2146c63b56bb6a45149d7325ac&heads=1326fa26d0c00d2146c63b56bb6a45149d7325ac&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) |
|
342 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=1326fa26d0c00d2146c63b56bb6a45149d7325ac&heads=1326fa26d0c00d2146c63b56bb6a45149d7325ac&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) | |
331 | $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
343 | $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=capabilities HTTP/1.1" 200 - (glob) | |
|
344 | $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) | |||
|
345 | $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=65903cebad86f1a84bd4f1134f62fa7dcb7a1c98&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) | |||
|
346 | $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=capabilities HTTP/1.1" 200 - (glob) | |||
|
347 | $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) | |||
|
348 | $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=31ecbdafd357f54b281c9bd1d681bb90de219e22&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) | |||
332 |
|
349 | |||
333 | $ killdaemons.py |
|
350 | $ killdaemons.py | |
334 | $ rm hg1.pid error.log access.log |
|
351 | $ rm hg1.pid error.log access.log |
@@ -84,8 +84,9 b' Test sharing with a remote URL reference' | |||||
84 | adding .hgsub |
|
84 | adding .hgsub | |
85 | $ cd .. |
|
85 | $ cd .. | |
86 |
|
86 | |||
87 | BUG: Remote subrepos cannot be shared, and pooled repos don't have their |
|
87 | Clone pooling works for local clones with a remote subrepo reference. | |
88 | relative subrepos in the relative location stated in .hgsub. |
|
88 | ||
|
89 | BUG: subrepos should be shared out of the pool. | |||
89 |
|
90 | |||
90 | $ hg --config extensions.share= --config share.pool=$TESTTMP/pool \ |
|
91 | $ hg --config extensions.share= --config share.pool=$TESTTMP/pool \ | |
91 | > clone absolute_subrepo cloned_from_abs |
|
92 | > clone absolute_subrepo cloned_from_abs | |
@@ -99,31 +100,55 b' relative subrepos in the relative locati' | |||||
99 | searching for changes |
|
100 | searching for changes | |
100 | no changes found |
|
101 | no changes found | |
101 | updating working directory |
|
102 | updating working directory | |
102 |
|
|
103 | cloning subrepo sub from http://localhost:$HGPORT/sub | |
103 | abort: can only share local repositories (in subrepository "sub") |
|
104 | requesting all changes | |
104 | [255] |
|
105 | adding changesets | |
|
106 | adding manifests | |||
|
107 | adding file changes | |||
|
108 | added 1 changesets with 1 changes to 1 files | |||
|
109 | new changesets 863c1745b441 | |||
|
110 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
111 | ||||
|
112 | Vanilla sharing with a subrepo remote path reference will clone the subrepo. | |||
|
113 | Each share of these top level repos will end up with independent subrepo copies | |||
|
114 | (potentially leaving the shared parent with dangling cset references). | |||
105 |
|
115 | |||
106 | $ hg --config extensions.share= share absolute_subrepo shared_from_abs |
|
116 | $ hg --config extensions.share= share absolute_subrepo shared_from_abs | |
107 | updating working directory |
|
117 | updating working directory | |
108 |
|
|
118 | cloning subrepo sub from http://localhost:$HGPORT/sub | |
109 | abort: can only share local repositories (in subrepository "sub") |
|
119 | requesting all changes | |
110 | [255] |
|
120 | adding changesets | |
|
121 | adding manifests | |||
|
122 | adding file changes | |||
|
123 | added 1 changesets with 1 changes to 1 files | |||
|
124 | new changesets 863c1745b441 | |||
|
125 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
111 |
|
126 | |||
112 | $ hg --config extensions.share= share -U absolute_subrepo shared_from_abs2 |
|
127 | $ hg --config extensions.share= share -U absolute_subrepo shared_from_abs2 | |
113 | $ hg -R shared_from_abs2 update -r tip |
|
128 | $ hg -R shared_from_abs2 update -r tip | |
114 |
|
|
129 | cloning subrepo sub from http://localhost:$HGPORT/sub | |
115 | abort: can only share local repositories (in subrepository "sub") |
|
130 | requesting all changes | |
116 | [255] |
|
131 | adding changesets | |
|
132 | adding manifests | |||
|
133 | adding file changes | |||
|
134 | added 1 changesets with 1 changes to 1 files | |||
|
135 | new changesets 863c1745b441 | |||
|
136 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
117 |
|
137 | |||
118 |
|
|
138 | A parent repo without its subrepo available locally can be shared if the | |
119 | subrepo is referenced by absolute path. |
|
139 | subrepo is referenced by absolute path. | |
120 |
|
140 | |||
121 | $ hg clone -U absolute_subrepo cloned_null_from_abs |
|
141 | $ hg clone -U absolute_subrepo cloned_null_from_abs | |
122 | $ hg --config extensions.share= share cloned_null_from_abs shared_from_null_abs |
|
142 | $ hg --config extensions.share= share cloned_null_from_abs shared_from_null_abs | |
123 | updating working directory |
|
143 | updating working directory | |
124 |
|
|
144 | cloning subrepo sub from http://localhost:$HGPORT/sub | |
125 | abort: can only share local repositories (in subrepository "sub") |
|
145 | requesting all changes | |
126 | [255] |
|
146 | adding changesets | |
|
147 | adding manifests | |||
|
148 | adding file changes | |||
|
149 | added 1 changesets with 1 changes to 1 files | |||
|
150 | new changesets 863c1745b441 | |||
|
151 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
127 |
|
152 | |||
128 | $ killdaemons.py |
|
153 | $ killdaemons.py | |
129 |
|
154 |
General Comments 0
You need to be logged in to leave comments.
Login now