hgext/share.py
changeset 23883 7e71898a7cdc
parent 23666 965788d9ae09
child 24364 135b23868f45
equal deleted inserted replaced
23882:272b1cc3e83e 23883:7e71898a7cdc
    77     extensions.wrapfunction(bookmarks.bmstore, 'write', write)
    77     extensions.wrapfunction(bookmarks.bmstore, 'write', write)
    78 
    78 
    79 def _hassharedbookmarks(repo):
    79 def _hassharedbookmarks(repo):
    80     """Returns whether this repo has shared bookmarks"""
    80     """Returns whether this repo has shared bookmarks"""
    81     try:
    81     try:
    82         repo.vfs.read('bookmarks.shared')
    82         shared = repo.vfs.read('shared').splitlines()
    83         return True
       
    84     except IOError, inst:
    83     except IOError, inst:
    85         if inst.errno != errno.ENOENT:
    84         if inst.errno != errno.ENOENT:
    86             raise
    85             raise
    87         return False
    86         return False
       
    87     return 'bookmarks' in shared
    88 
    88 
    89 def _getsrcrepo(repo):
    89 def _getsrcrepo(repo):
    90     """
    90     """
    91     Returns the source repository object for a given shared repository.
    91     Returns the source repository object for a given shared repository.
    92     If repo is not a shared repository, return None.
    92     If repo is not a shared repository, return None.