##// END OF EJS Templates
localrepo: introduce shared method to check if a repository is shared...
Angel Ezquerra -
r23666:965788d9 default
parent child Browse files
Show More
@@ -46,7 +46,7 b' def unshare(ui, repo):'
46 46 Copy the store data to the repo and remove the sharedpath data.
47 47 """
48 48
49 if repo.sharedpath == repo.path:
49 if not repo.shared():
50 50 raise util.Abort(_("this is not a shared repo"))
51 51
52 52 destlock = lock = None
@@ -758,6 +758,12 b' class localrepository(object):'
758 758 # if publishing we can't copy if there is filtered content
759 759 return not self.filtered('visible').changelog.filteredrevs
760 760
761 def shared(self):
762 '''the type of shared repository (None if not shared)'''
763 if self.sharedpath != self.path:
764 return 'store'
765 return None
766
761 767 def join(self, f, *insidef):
762 768 return os.path.join(self.path, f, *insidef)
763 769
@@ -302,7 +302,7 b' def _abssource(repo, push=False, abort=T'
302 302 return repo.ui.config('paths', 'default-push')
303 303 if repo.ui.config('paths', 'default'):
304 304 return repo.ui.config('paths', 'default')
305 if repo.sharedpath != repo.path:
305 if repo.shared():
306 306 # chop off the .hg component to get the default path form
307 307 return os.path.dirname(repo.sharedpath)
308 308 if abort:
General Comments 0
You need to be logged in to leave comments. Login now