Mercurial > public > mercurial-scm > hg
comparison mercurial/hg.py @ 34879:7d51a7792f52
subrepo: implement 'unshare' for Mercurial subrepos
I think there's a slight hole here in that a subrepo could be shared, removed
from .hgsub, and then it's not part of context.substate (so not iterated over).
But the push command has the same hole IIRC, and I think removing a subrepo is
an edge case.
The import hack is a copy/paste of subrepo.subrepo().
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Tue, 17 Oct 2017 22:55:33 -0400 |
parents | 9f7ecc5bbc28 |
children | b64ea7fb9599 |
comparison
equal
deleted
inserted
replaced
34878:9f7ecc5bbc28 | 34879:7d51a7792f52 |
---|---|
283 destlock and destlock.release() | 283 destlock and destlock.release() |
284 lock and lock.release() | 284 lock and lock.release() |
285 | 285 |
286 # update store, spath, svfs and sjoin of repo | 286 # update store, spath, svfs and sjoin of repo |
287 repo.unfiltered().__init__(repo.baseui, repo.root) | 287 repo.unfiltered().__init__(repo.baseui, repo.root) |
288 | |
289 # TODO: figure out how to access subrepos that exist, but were previously | |
290 # removed from .hgsub | |
291 c = repo['.'] | |
292 subs = c.substate | |
293 for s in sorted(subs): | |
294 c.sub(s).unshare() | |
288 | 295 |
289 def postshare(sourcerepo, destrepo, bookmarks=True, defaultpath=None): | 296 def postshare(sourcerepo, destrepo, bookmarks=True, defaultpath=None): |
290 """Called after a new shared repo is created. | 297 """Called after a new shared repo is created. |
291 | 298 |
292 The new repo only has a requirements file and pointer to the source. | 299 The new repo only has a requirements file and pointer to the source. |