comparison mercurial/localrepo.py @ 37172:daef13da66fe

context: avoid using a context object as a changeid I find it misleading to pass changeid=changectx. It currently works to do that because there's weird (IMO) handling of it in basectx.__new__. I'm planning on removing that code. Passing changeid as "changeid" and context as "context" makes it more readable. Note that the documentation of filectx.__init__ doesn't even seem to be aware that a changeid can be a context ("changeset revision, node, or tag"). Differential Revision: https://phab.mercurial-scm.org/D2967
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 29 Mar 2018 21:29:15 -0700
parents db90a5793103
children bb47dc2f71a0
comparison
equal deleted inserted replaced
37171:d7f3fdab94c4 37172:daef13da66fe
1084 if p2 == nullid: 1084 if p2 == nullid:
1085 for f, s in sorted(self.dirstate.copies().items()): 1085 for f, s in sorted(self.dirstate.copies().items()):
1086 if f not in pctx and s not in pctx: 1086 if f not in pctx and s not in pctx:
1087 self.dirstate.copy(None, f) 1087 self.dirstate.copy(None, f)
1088 1088
1089 def filectx(self, path, changeid=None, fileid=None): 1089 def filectx(self, path, changeid=None, fileid=None, changectx=None):
1090 """changeid can be a changeset revision, node, or tag. 1090 """changeid can be a changeset revision, node, or tag.
1091 fileid can be a file revision or node.""" 1091 fileid can be a file revision or node."""
1092 return context.filectx(self, path, changeid, fileid) 1092 return context.filectx(self, path, changeid, fileid,
1093 changectx=changectx)
1093 1094
1094 def getcwd(self): 1095 def getcwd(self):
1095 return self.dirstate.getcwd() 1096 return self.dirstate.getcwd()
1096 1097
1097 def pathto(self, f, cwd=None): 1098 def pathto(self, f, cwd=None):