##// END OF EJS Templates
bundleoperation: optionnaly record the `remote` that produced the bundle...
bundleoperation: optionnaly record the `remote` that produced the bundle We have the information at hand, and the peer now have knownledge of its `path` object, which constaints useful behavior configuration. So the simpler seems to be to pass that object around so it can be used if needed.

File last commit:

r50648:ff7134e0 default
r50659:4188e75a default
Show More
narrowrepo.py
28 lines | 890 B | text/x-python | PythonLexer
# 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 mercurial import wireprototypes
from . import narrowdirstate
def wraprepo(repo):
"""Enables narrow clone functionality on a single local repository."""
class narrowrepository(repo.__class__):
def _makedirstate(self):
dirstate = super(narrowrepository, self)._makedirstate()
return narrowdirstate.wrapdirstate(self, dirstate)
def peer(self, path=None):
peer = super(narrowrepository, self).peer(path=path)
peer._caps.add(wireprototypes.NARROWCAP)
peer._caps.add(wireprototypes.ELLIPSESCAP)
return peer
repo.__class__ = narrowrepository