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 (6 lines) | |||
M | mercurial/repoview.py (6 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 revs(self, start=0, stop=None): | |||||
"""filtered version of revlog.revs""" | |||||
for i in super(changelog, self).revs(start, stop): | |||||
if i not in self.filteredrevs: | |||||
yield i | |||||
def _checknofilteredinrevs(self, revs): | def _checknofilteredinrevs(self, revs): | ||||
"""raise the appropriate error if 'revs' contains a filtered revision | """raise the appropriate error if 'revs' contains a filtered revision | ||||
This returns a version of 'revs' to be used thereafter by the caller. | This returns a version of 'revs' to be used thereafter by the caller. | ||||
In particular, if revs is an iterator, it is converted into a set. | In particular, if revs is an iterator, it is converted into a set. | ||||
""" | """ | ||||
safehasattr = util.safehasattr | safehasattr = util.safehasattr | ||||
if safehasattr(revs, '__next__'): | if safehasattr(revs, '__next__'): |
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: | ||||
yield i | yield i | ||||
return filterediter() | return filterediter() | ||||
def revs(self, start=0, stop=None): | |||||
"""filtered version of revlog.revs""" | |||||
for i in super(filteredchangelog, self).revs(start, stop): | |||||
if i not in self.filteredrevs: | |||||
yield 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 | ||||
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 |