D2967: context: avoid using a context object as a changeid
This revision was automatically updated to reflect the committed changes. Closed by commit rHGdaef13da66fe: context: avoid using a context object as a changeid (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2967?vs=7369=7390 REVISION DETAIL https://phab.mercurial-scm.org/D2967 AFFECTED FILES mercurial/localrepo.py mercurial/merge.py CHANGE DETAILS diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -561,7 +561,7 @@ fcd = self._filectxorabsent(hash, wctx, dfile) fco = self._filectxorabsent(onode, octx, ofile) # TODO: move this to filectxorabsent -fca = self._repo.filectx(afile, fileid=anode, changeid=actx) +fca = self._repo.filectx(afile, fileid=anode, changectx=actx) # "premerge" x flags flo = fco.flags() fla = fca.flags() diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -1086,10 +1086,11 @@ if f not in pctx and s not in pctx: self.dirstate.copy(None, f) -def filectx(self, path, changeid=None, fileid=None): +def filectx(self, path, changeid=None, fileid=None, changectx=None): """changeid can be a changeset revision, node, or tag. fileid can be a file revision or node.""" -return context.filectx(self, path, changeid, fileid) +return context.filectx(self, path, changeid, fileid, + changectx=changectx) def getcwd(self): return self.dirstate.getcwd() To: martinvonz, #hg-reviewers, indygreg Cc: indygreg, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2967: context: avoid using a context object as a changeid
indygreg accepted this revision. indygreg added a comment. This revision is now accepted and ready to land. Oh wow. Thanks for cleaning this up. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2967 To: martinvonz, #hg-reviewers, indygreg Cc: indygreg, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2967: context: avoid using a context object as a changeid
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY 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"). REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2967 AFFECTED FILES mercurial/localrepo.py mercurial/merge.py CHANGE DETAILS diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -561,7 +561,7 @@ fcd = self._filectxorabsent(hash, wctx, dfile) fco = self._filectxorabsent(onode, octx, ofile) # TODO: move this to filectxorabsent -fca = self._repo.filectx(afile, fileid=anode, changeid=actx) +fca = self._repo.filectx(afile, fileid=anode, changectx=actx) # "premerge" x flags flo = fco.flags() fla = fca.flags() diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -1086,10 +1086,11 @@ if f not in pctx and s not in pctx: self.dirstate.copy(None, f) -def filectx(self, path, changeid=None, fileid=None): +def filectx(self, path, changeid=None, fileid=None, changectx=None): """changeid can be a changeset revision, node, or tag. fileid can be a file revision or node.""" -return context.filectx(self, path, changeid, fileid) +return context.filectx(self, path, changeid, fileid, + changectx=changectx) def getcwd(self): return self.dirstate.getcwd() To: martinvonz, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel