Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/changelog.py (9 lines) | |||
M | mercurial/repoview.py (15 lines) |
Status | Author | Revision | |
---|---|---|---|
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz |
self._realopener = opener | self._realopener = opener | ||||
self._delayed = False | self._delayed = False | ||||
self._delaybuf = None | self._delaybuf = None | ||||
self._divert = False | self._divert = False | ||||
self.filteredrevs = frozenset() | self.filteredrevs = frozenset() | ||||
self._copiesstorage = opener.options.get(b'copies-storage') | self._copiesstorage = opener.options.get(b'copies-storage') | ||||
def rev(self, node): | |||||
"""filtered version of revlog.rev""" | |||||
r = super(changelog, self).rev(node) | |||||
if r in self.filteredrevs: | |||||
raise error.FilteredLookupError( | |||||
hex(node), self.indexfile, _(b'filtered node') | |||||
) | |||||
return r | |||||
def node(self, rev): | def node(self, rev): | ||||
"""filtered version of revlog.node""" | """filtered version of revlog.node""" | ||||
if rev in self.filteredrevs: | if rev in self.filteredrevs: | ||||
raise error.FilteredIndexError(rev) | raise error.FilteredIndexError(rev) | ||||
return super(changelog, self).node(rev) | return super(changelog, self).node(rev) | ||||
def linkrev(self, rev): | def linkrev(self, rev): | ||||
"""filtered version of revlog.linkrev""" | """filtered version of revlog.linkrev""" |
# repoview.py - Filtered view of a localrepo object | # repoview.py - Filtered view of a localrepo object | ||||
# | # | ||||
# Copyright 2012 Pierre-Yves David <pierre-yves.david@ens-lyon.org> | # Copyright 2012 Pierre-Yves David <pierre-yves.david@ens-lyon.org> | ||||
# Logilab SA <contact@logilab.fr> | # Logilab SA <contact@logilab.fr> | ||||
# | # | ||||
# This software may be used and distributed according to the terms of the | # This software may be used and distributed according to the terms of the | ||||
# GNU General Public License version 2 or any later version. | # GNU General Public License version 2 or any later version. | ||||
from __future__ import absolute_import | from __future__ import absolute_import | ||||
import copy | import copy | ||||
import weakref | import weakref | ||||
from .node import nullrev | from .i18n import _ | ||||
from .node import ( | |||||
hex, | |||||
nullrev, | |||||
) | |||||
from .pycompat import ( | from .pycompat import ( | ||||
delattr, | delattr, | ||||
getattr, | getattr, | ||||
setattr, | setattr, | ||||
) | ) | ||||
from . import ( | from . import ( | ||||
error, | error, | ||||
obsolete, | obsolete, | ||||
return super(filteredchangelog, self).headrevs(revs) | return super(filteredchangelog, self).headrevs(revs) | ||||
def strip(self, *args, **kwargs): | def strip(self, *args, **kwargs): | ||||
# XXX make something better than assert | # XXX make something better than assert | ||||
# We can't expect proper strip behavior if we are filtered. | # We can't expect proper strip behavior if we are filtered. | ||||
assert not self.filteredrevs | assert not self.filteredrevs | ||||
super(filteredchangelog, self).strip(*args, **kwargs) | super(filteredchangelog, self).strip(*args, **kwargs) | ||||
def rev(self, node): | |||||
"""filtered version of revlog.rev""" | |||||
r = super(filteredchangelog, self).rev(node) | |||||
if r in self.filteredrevs: | |||||
raise error.FilteredLookupError( | |||||
hex(node), self.indexfile, _(b'filtered node') | |||||
) | |||||
return r | |||||
cl.__class__ = filteredchangelog | cl.__class__ = filteredchangelog | ||||
return cl | return cl | ||||
class repoview(object): | class repoview(object): | ||||
"""Provide a read/write view of a repo through a filtered changelog | """Provide a read/write view of a repo through a filtered changelog | ||||
This object is used to access a filtered version of a repository without | This object is used to access a filtered version of a repository without |