##// END OF EJS Templates
watchman: refactor transport connecting to unconfuse pytype...
watchman: refactor transport connecting to unconfuse pytype Pytype sees `self.proc` as potentially `None` here, even though it's set by the `_connect()` logic. Instead of asserting, simply use the process returned by that method (which it sets into `self.proc` before returning, so there's no functional change here).

File last commit:

r50648:ff7134e0 default
r50751:40d3ee57 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