##// END OF EJS Templates
subrepo: don't attempt to share remote sources (issue5793)...
Matt Harbison -
r36705:eed02e19 stable
parent child Browse files
Show More
@@ -982,7 +982,13 b' class hgsubrepo(abstractsubrepo):'
982 982 if len(self._repo) == 0:
983 983 # use self._repo.vfs instead of self.wvfs to remove .hg only
984 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 992 self.ui.status(_('sharing subrepo %s from %s\n')
987 993 % (subrelpath(self), srcurl))
988 994 shared = hg.share(self._repo._subparent.baseui,
@@ -307,9 +307,21 b' from there.'
307 307 searching for changes
308 308 no changes found
309 309 updating working directory
310 sharing subrepo foo from http://localhost:$HGPORT/foo
311 abort: can only share local repositories (in subrepository "foo")
312 [255]
310 cloning subrepo foo from http://localhost:$HGPORT/foo
311 requesting all changes
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 326 $ cat access.log
315 327 * "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
@@ -329,6 +341,11 b' from there.'
329 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 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 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 350 $ killdaemons.py
334 351 $ rm hg1.pid error.log access.log
@@ -84,8 +84,9 b' Test sharing with a remote URL reference'
84 84 adding .hgsub
85 85 $ cd ..
86 86
87 BUG: Remote subrepos cannot be shared, and pooled repos don't have their
88 relative subrepos in the relative location stated in .hgsub.
87 Clone pooling works for local clones with a remote subrepo reference.
88
89 BUG: subrepos should be shared out of the pool.
89 90
90 91 $ hg --config extensions.share= --config share.pool=$TESTTMP/pool \
91 92 > clone absolute_subrepo cloned_from_abs
@@ -99,31 +100,55 b' relative subrepos in the relative locati'
99 100 searching for changes
100 101 no changes found
101 102 updating working directory
102 sharing subrepo sub from http://localhost:$HGPORT/sub
103 abort: can only share local repositories (in subrepository "sub")
104 [255]
103 cloning subrepo sub from http://localhost:$HGPORT/sub
104 requesting all changes
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 116 $ hg --config extensions.share= share absolute_subrepo shared_from_abs
107 117 updating working directory
108 sharing subrepo sub from http://localhost:$HGPORT/sub
109 abort: can only share local repositories (in subrepository "sub")
110 [255]
118 cloning subrepo sub from http://localhost:$HGPORT/sub
119 requesting all changes
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 127 $ hg --config extensions.share= share -U absolute_subrepo shared_from_abs2
113 128 $ hg -R shared_from_abs2 update -r tip
114 sharing subrepo sub from http://localhost:$HGPORT/sub
115 abort: can only share local repositories (in subrepository "sub")
116 [255]
129 cloning subrepo sub from http://localhost:$HGPORT/sub
130 requesting all changes
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 BUG: A repo without its subrepo available locally should be sharable if the
138 A parent repo without its subrepo available locally can be shared if the
119 139 subrepo is referenced by absolute path.
120 140
121 141 $ hg clone -U absolute_subrepo cloned_null_from_abs
122 142 $ hg --config extensions.share= share cloned_null_from_abs shared_from_null_abs
123 143 updating working directory
124 sharing subrepo sub from http://localhost:$HGPORT/sub
125 abort: can only share local repositories (in subrepository "sub")
126 [255]
144 cloning subrepo sub from http://localhost:$HGPORT/sub
145 requesting all changes
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 153 $ killdaemons.py
129 154
General Comments 0
You need to be logged in to leave comments. Login now