diff --git a/hgext/share.py b/hgext/share.py --- a/hgext/share.py +++ b/hgext/share.py @@ -46,7 +46,7 @@ def unshare(ui, repo): Copy the store data to the repo and remove the sharedpath data. """ - if repo.sharedpath == repo.path: + if not repo.shared(): raise util.Abort(_("this is not a shared repo")) destlock = lock = None diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -758,6 +758,12 @@ class localrepository(object): # if publishing we can't copy if there is filtered content return not self.filtered('visible').changelog.filteredrevs + def shared(self): + '''the type of shared repository (None if not shared)''' + if self.sharedpath != self.path: + return 'store' + return None + def join(self, f, *insidef): return os.path.join(self.path, f, *insidef) diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py --- a/mercurial/subrepo.py +++ b/mercurial/subrepo.py @@ -302,7 +302,7 @@ def _abssource(repo, push=False, abort=T return repo.ui.config('paths', 'default-push') if repo.ui.config('paths', 'default'): return repo.ui.config('paths', 'default') - if repo.sharedpath != repo.path: + if repo.shared(): # chop off the .hg component to get the default path form return os.path.dirname(repo.sharedpath) if abort: