##// END OF EJS Templates
worker: silence type error when calling pickle...
worker: silence type error when calling pickle pytype is complaining that the argument to `pickle.load()` is not an `IO`. pytype isn't wrong: `_blockingreader` doesn't implement `io.RawIOBase`, only `read()` and `readline()`. But it appears this is enough for pickle. So we silence the false positive. This fixes a regression introduced by D12304 / cc0e059d2af8: worker: remove Python 2 support code. Differential Revision: https://phab.mercurial-scm.org/D12337

File last commit:

r49730:6000f5b2 default
r49767:a0674e91 default
Show More
narrowrepo.py
28 lines | 870 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):
peer = super(narrowrepository, self).peer()
peer._caps.add(wireprototypes.NARROWCAP)
peer._caps.add(wireprototypes.ELLIPSESCAP)
return peer
repo.__class__ = narrowrepository