##// END OF EJS Templates
revlog: drop LookupError alias (API)...
revlog: drop LookupError alias (API) This alias is especially bad because it shadows the built-in LookupError type. This has caused me confusion in the past when reading revlog code. Qualifying all uses with "error." will make it obvious that we're using a Mercurial error type. Differential Revision: https://phab.mercurial-scm.org/D4653

File last commit:

r39802:9358f506 default
r39811:97459247 default
Show More
narrowrepo.py
30 lines | 900 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 __future__ import absolute_import
from . import (
narrowdirstate,
narrowwirepeer,
)
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(narrowwirepeer.NARROWCAP)
peer._caps.add(narrowwirepeer.ELLIPSESCAP)
return peer
repo.__class__ = narrowrepository