Show More
@@ -235,13 +235,7 b' def share(ui, source, dest=None, update=' | |||||
235 | destvfs.write('sharedpath', sharedpath) |
|
235 | destvfs.write('sharedpath', sharedpath) | |
236 |
|
236 | |||
237 | r = repository(ui, destwvfs.base) |
|
237 | r = repository(ui, destwvfs.base) | |
238 |
|
238 | postshare(srcrepo, r, bookmarks=bookmarks) | ||
239 | default = srcrepo.ui.config('paths', 'default') |
|
|||
240 | if default: |
|
|||
241 | fp = r.vfs("hgrc", "w", text=True) |
|
|||
242 | fp.write("[paths]\n") |
|
|||
243 | fp.write("default = %s\n" % default) |
|
|||
244 | fp.close() |
|
|||
245 |
|
239 | |||
246 | if update: |
|
240 | if update: | |
247 | r.ui.status(_("updating working directory\n")) |
|
241 | r.ui.status(_("updating working directory\n")) | |
@@ -257,8 +251,24 b' def share(ui, source, dest=None, update=' | |||||
257 | continue |
|
251 | continue | |
258 | _update(r, uprev) |
|
252 | _update(r, uprev) | |
259 |
|
253 | |||
|
254 | def postshare(sourcerepo, destrepo, bookmarks=True): | |||
|
255 | """Called after a new shared repo is created. | |||
|
256 | ||||
|
257 | The new repo only has a requirements file and pointer to the source. | |||
|
258 | This function configures additional shared data. | |||
|
259 | ||||
|
260 | Extensions can wrap this function and write additional entries to | |||
|
261 | destrepo/.hg/shared to indicate additional pieces of data to be shared. | |||
|
262 | """ | |||
|
263 | default = sourcerepo.ui.config('paths', 'default') | |||
|
264 | if default: | |||
|
265 | fp = destrepo.vfs("hgrc", "w", text=True) | |||
|
266 | fp.write("[paths]\n") | |||
|
267 | fp.write("default = %s\n" % default) | |||
|
268 | fp.close() | |||
|
269 | ||||
260 | if bookmarks: |
|
270 | if bookmarks: | |
261 | fp = r.vfs('shared', 'w') |
|
271 | fp = destrepo.vfs('shared', 'w') | |
262 | fp.write('bookmarks\n') |
|
272 | fp.write('bookmarks\n') | |
263 | fp.close() |
|
273 | fp.close() | |
264 |
|
274 |
General Comments 0
You need to be logged in to leave comments.
Login now