Mercurial > hg
view hgext/narrow/narrowrepo.py @ 39529:e82da0fcc7c5
narrow: move wire proto capabilities to narrowwirepeer
These are not bundle2 capabilities (they just happened to share the
name "narrow"), so they seem to belong with the wirepeer overrides.
Differential Revision: https://phab.mercurial-scm.org/D4528
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 11 Sep 2018 10:50:46 -0700 |
parents | 2862e9b868c5 |
children | 9358f5066811 |
line wrap: on
line source
# narrowrepo.py - repository which supports narrow revlogs, lazy loading # # Copyright 2017 Google, Inc. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from __future__ import absolute_import from . import ( narrowdirstate, narrowrevlog, narrowwirepeer, ) def wraprepo(repo): """Enables narrow clone functionality on a single local repository.""" class narrowrepository(repo.__class__): def file(self, f): fl = super(narrowrepository, self).file(f) narrowrevlog.makenarrowfilelog(fl, self.narrowmatch()) return fl def _makedirstate(self): dirstate = super(narrowrepository, self)._makedirstate() return narrowdirstate.wrapdirstate(self, dirstate) def peer(self): peer = super(narrowrepository, self).peer() peer._caps.add(narrowwirepeer.NARROWCAP) peer._caps.add(narrowwirepeer.ELLIPSESCAP) return peer repo.__class__ = narrowrepository