151 return _peerlookup(repo).islocal(repo) |
151 return _peerlookup(repo).islocal(repo) |
152 except AttributeError: |
152 except AttributeError: |
153 return False |
153 return False |
154 return repo.local() |
154 return repo.local() |
155 |
155 |
156 def openpath(ui, path): |
156 def openpath(ui, path, sendaccept=True): |
157 '''open path with open if local, url.open if remote''' |
157 '''open path with open if local, url.open if remote''' |
158 pathurl = util.url(path, parsequery=False, parsefragment=False) |
158 pathurl = util.url(path, parsequery=False, parsefragment=False) |
159 if pathurl.islocal(): |
159 if pathurl.islocal(): |
160 return util.posixfile(pathurl.localpath(), 'rb') |
160 return util.posixfile(pathurl.localpath(), 'rb') |
161 else: |
161 else: |
162 return url.open(ui, path) |
162 return url.open(ui, path, sendaccept=sendaccept) |
163 |
163 |
164 # a list of (ui, repo) functions called for wire peer initialization |
164 # a list of (ui, repo) functions called for wire peer initialization |
165 wirepeersetupfuncs = [] |
165 wirepeersetupfuncs = [] |
166 |
166 |
167 def _peerorrepo(ui, path, create=False, presetupfuncs=None, |
167 def _peerorrepo(ui, path, create=False, presetupfuncs=None, |