Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 39957:e1e3d1b498d3
context: reduce dependence of changectx constructor
I want to change the constructor's signature and letting all creation
of changectx instances go through the repo simplifies that.
Differential Revision: https://phab.mercurial-scm.org/D4826
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Wed, 26 Sep 2018 22:44:51 -0700 |
parents | 823a580448d7 |
children | 3d35304bd09b |
comparison
equal
deleted
inserted
replaced
39956:36e9d2c60837 | 39957:e1e3d1b498d3 |
---|---|
1208 return context.workingctx(self) | 1208 return context.workingctx(self) |
1209 if isinstance(changeid, context.basectx): | 1209 if isinstance(changeid, context.basectx): |
1210 return changeid | 1210 return changeid |
1211 if isinstance(changeid, slice): | 1211 if isinstance(changeid, slice): |
1212 # wdirrev isn't contiguous so the slice shouldn't include it | 1212 # wdirrev isn't contiguous so the slice shouldn't include it |
1213 return [context.changectx(self, i) | 1213 return [self[i] |
1214 for i in pycompat.xrange(*changeid.indices(len(self))) | 1214 for i in pycompat.xrange(*changeid.indices(len(self))) |
1215 if i not in self.changelog.filteredrevs] | 1215 if i not in self.changelog.filteredrevs] |
1216 try: | 1216 try: |
1217 return context.changectx(self, changeid) | 1217 return context.changectx(self, changeid) |
1218 except error.WdirUnsupported: | 1218 except error.WdirUnsupported: |