##// END OF EJS Templates
py3: create built in exceptions with str type messages in win32.py...
py3: create built in exceptions with str type messages in win32.py I hit an IOError in unlink() in test-pathconflicts-basic.t, that then crashed as it was handled: File "mercurial\dispatch.py", line 359, in _runcatch return _callcatch(ui, _runcatchfunc) File "mercurial\dispatch.py", line 367, in _callcatch return scmutil.callcatch(ui, func) File "mercurial\scmutil.py", line 252, in callcatch ui.error(_("abort: %s\n") % encoding.strtolocal(inst.strerror)) File "mercurial\encoding.py", line 205, in unitolocal return tolocal(u.encode('utf-8')) AttributeError: 'bytes' object has no attribute 'encode'

File last commit:

r39565:e82da0fc default
r39798:edaa40dc default
Show More
narrowrepo.py
36 lines | 1.1 KiB | 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,
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