Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/changelog.py (4 lines) | |||
M | mercurial/repoview.py (4 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
225ce2e5f0fb | 000a76cb7f4e | Martin von Zweigbergk | Nov 5 2019, 5:11 PM |
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 __contains__(self, rev): | |||||
"""filtered version of revlog.__contains__""" | |||||
return 0 <= rev < len(self) and rev not in self.filteredrevs | |||||
def __iter__(self): | def __iter__(self): | ||||
"""filtered version of revlog.__iter__""" | """filtered version of revlog.__iter__""" | ||||
if len(self.filteredrevs) == 0: | if len(self.filteredrevs) == 0: | ||||
return revlog.revlog.__iter__(self) | return revlog.revlog.__iter__(self) | ||||
def filterediter(): | def filterediter(): | ||||
for i in pycompat.xrange(len(self)): | for i in pycompat.xrange(len(self)): | ||||
if i not in self.filteredrevs: | if i not in self.filteredrevs: |
class filteredchangelog(cl.__class__): | class filteredchangelog(cl.__class__): | ||||
def tiprev(self): | def tiprev(self): | ||||
"""filtered version of revlog.tiprev""" | """filtered version of revlog.tiprev""" | ||||
for i in pycompat.xrange(len(self) - 1, -2, -1): | for i in pycompat.xrange(len(self) - 1, -2, -1): | ||||
if i not in self.filteredrevs: | if i not in self.filteredrevs: | ||||
return i | return i | ||||
def __contains__(self, rev): | |||||
"""filtered version of revlog.__contains__""" | |||||
return 0 <= rev < len(self) and rev not in self.filteredrevs | |||||
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 |