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 (6 lines) | |||
M | mercurial/repoview.py (7 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
000a76cb7f4e | 3c9a7bd55770 | Martin von Zweigbergk | Nov 5 2019, 5:07 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 tiprev(self): | |||||
"""filtered version of revlog.tiprev""" | |||||
for i in pycompat.xrange(len(self) - 1, -2, -1): | |||||
if i not in self.filteredrevs: | |||||
return i | |||||
def __contains__(self, rev): | def __contains__(self, rev): | ||||
"""filtered version of revlog.__contains__""" | """filtered version of revlog.__contains__""" | ||||
return 0 <= rev < len(self) and rev not in self.filteredrevs | 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) |
repo.filteredrevcache[filtername] = func(repo.unfiltered()) | repo.filteredrevcache[filtername] = func(repo.unfiltered()) | ||||
return repo.filteredrevcache[filtername] | return repo.filteredrevcache[filtername] | ||||
def wrapchangelog(unfichangelog, filteredrevs): | def wrapchangelog(unfichangelog, filteredrevs): | ||||
cl = copy.copy(unfichangelog) | cl = copy.copy(unfichangelog) | ||||
cl.filteredrevs = filteredrevs | cl.filteredrevs = filteredrevs | ||||
class filteredchangelog(cl.__class__): | class filteredchangelog(cl.__class__): | ||||
pass | |||||
def tiprev(self): | |||||
"""filtered version of revlog.tiprev""" | |||||
for i in pycompat.xrange(len(self) - 1, -2, -1): | |||||
if i not in self.filteredrevs: | |||||
return i | |||||
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 | ||||