comparison mercurial/statichttprepo.py @ 50440:3a2df812e1c7

pull: add --remote-hidden option and pass it through peer creation This option will allow to pull changesets that are hidden on the remote. This is useful when looking into a changeset’s evolution history, resolving evolution instability or mirroring a repository. The option is best effort and will only affect the pull when it can. The option will be ignored when it cannot be honored. Support for each type of peer is yet to be implemented. They currently all warn about lack of support. The warning code will get removed as peers gain support for this option. The option is still experimental, so we will have freedom to update the UI or implementation before it graduates out of experimental. Based on a changeset by Pierre-Yves David, which added the option.
author Manuel Jacob <me@manueljacob.de>
date Thu, 04 Apr 2019 18:07:30 +0200
parents 3eacb4a54313
children 81224afd938d
comparison
equal deleted inserted replaced
50439:4077d6222cf1 50440:3a2df812e1c7
235 return self._url 235 return self._url
236 236
237 def local(self): 237 def local(self):
238 return False 238 return False
239 239
240 def peer(self, path=None): 240 def peer(self, path=None, remotehidden=False):
241 return statichttppeer(self, path=path) 241 return statichttppeer(self, path=path, remotehidden=remotehidden)
242 242
243 def wlock(self, wait=True): 243 def wlock(self, wait=True):
244 raise error.LockUnavailable( 244 raise error.LockUnavailable(
245 0, 245 0,
246 _(b'lock not available'), 246 _(b'lock not available'),
258 258
259 def _writecaches(self): 259 def _writecaches(self):
260 pass # statichttprepository are read only 260 pass # statichttprepository are read only
261 261
262 262
263 def make_peer(ui, path, create, intents=None, createopts=None): 263 def make_peer(
264 ui, path, create, intents=None, createopts=None, remotehidden=False
265 ):
264 if create: 266 if create:
265 raise error.Abort(_(b'cannot create new static-http repository')) 267 raise error.Abort(_(b'cannot create new static-http repository'))
266 url = path.loc[7:] 268 url = path.loc[7:]
267 return statichttprepository(ui, url).peer(path=path) 269 return statichttprepository(ui, url).peer(
270 path=path, remotehidden=remotehidden
271 )