Mercurial > public > mercurial-scm > hg
comparison mercurial/bundlerepo.py @ 37717:0664be4f0c1f
hg: pass command intents to repo/peer creation (API)
The previous commit introduced a mechanism to declare command intents.
This commit changes the repository and peer instantiation mechanism
so the intents are passed down to each repository and peer type so
they can do with them whatever they please.
Currently, nobody does anything with any intent.
Differential Revision: https://phab.mercurial-scm.org/D3377
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 14 Apr 2018 09:57:44 -0700 |
parents | 1aa4d646d0de |
children | 2ce60954b1b7 |
comparison
equal
deleted
inserted
replaced
37716:dfc51a482031 | 37717:0664be4f0c1f |
---|---|
448 self.ui.warn(msg % nodemod.hex(p1)) | 448 self.ui.warn(msg % nodemod.hex(p1)) |
449 if self.changelog.repotiprev < p2rev: | 449 if self.changelog.repotiprev < p2rev: |
450 self.ui.warn(msg % nodemod.hex(p2)) | 450 self.ui.warn(msg % nodemod.hex(p2)) |
451 return super(bundlerepository, self).setparents(p1, p2) | 451 return super(bundlerepository, self).setparents(p1, p2) |
452 | 452 |
453 def instance(ui, path, create): | 453 def instance(ui, path, create, intents=None): |
454 if create: | 454 if create: |
455 raise error.Abort(_('cannot create new bundle repository')) | 455 raise error.Abort(_('cannot create new bundle repository')) |
456 # internal config: bundle.mainreporoot | 456 # internal config: bundle.mainreporoot |
457 parentpath = ui.config("bundle", "mainreporoot") | 457 parentpath = ui.config("bundle", "mainreporoot") |
458 if not parentpath: | 458 if not parentpath: |