There are different early processing before getting to the core of the function.
We highlight that fact.
Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
There are different early processing before getting to the core of the function.
We highlight that fact.
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/localrepo.py (5 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
01ae1a767658 | d155bf11cf22 | Pierre-Yves David | Nov 16 2019, 9:27 PM |
return matchmod.intersectmatchers(match, self._narrowmatch) | return matchmod.intersectmatchers(match, self._narrowmatch) | ||||
return self._narrowmatch | return self._narrowmatch | ||||
def setnarrowpats(self, newincludes, newexcludes): | def setnarrowpats(self, newincludes, newexcludes): | ||||
narrowspec.save(self, newincludes, newexcludes) | narrowspec.save(self, newincludes, newexcludes) | ||||
self.invalidate(clearfilecache=True) | self.invalidate(clearfilecache=True) | ||||
def __getitem__(self, changeid): | def __getitem__(self, changeid): | ||||
# dealing with special cases | |||||
if changeid is None: | if changeid is None: | ||||
return context.workingctx(self) | return context.workingctx(self) | ||||
if isinstance(changeid, context.basectx): | if isinstance(changeid, context.basectx): | ||||
return changeid | return changeid | ||||
# dealing with multiple revisions | |||||
if isinstance(changeid, slice): | if isinstance(changeid, slice): | ||||
# wdirrev isn't contiguous so the slice shouldn't include it | # wdirrev isn't contiguous so the slice shouldn't include it | ||||
return [ | return [ | ||||
self[i] | self[i] | ||||
for i in pycompat.xrange(*changeid.indices(len(self))) | for i in pycompat.xrange(*changeid.indices(len(self))) | ||||
if i not in self.changelog.filteredrevs | if i not in self.changelog.filteredrevs | ||||
] | ] | ||||
# dealing with arbitrary values | |||||
try: | try: | ||||
if isinstance(changeid, int): | if isinstance(changeid, int): | ||||
node = self.changelog.node(changeid) | node = self.changelog.node(changeid) | ||||
rev = changeid | rev = changeid | ||||
elif changeid == b'null': | elif changeid == b'null': | ||||
node = nullid | node = nullid | ||||
rev = nullrev | rev = nullrev | ||||
elif changeid == b'tip': | elif changeid == b'tip': |