# HG changeset patch # User Sean Farley # Date 1376279841 18000 # Node ID cf7322cb1c13b7598e9a083a6a262b7fe285bb66 # Parent ef7c47e4002f31afc516d6d005b28ec4f08ff4b8 basefilectx: move parents from filectx diff -r ef7c47e4002f -r cf7322cb1c13 mercurial/context.py --- a/mercurial/context.py Sun Aug 11 22:56:53 2013 -0500 +++ b/mercurial/context.py Sun Aug 11 22:57:21 2013 -0500 @@ -538,6 +538,18 @@ return True + def parents(self): + p = self._path + fl = self._filelog + pl = [(p, n, fl) for n in self._filelog.parents(self._filenode)] + + r = self._filelog.renamed(self._filenode) + if r: + pl[0] = (r[0], r[1], None) + + return [filectx(self._repo, p, fileid=n, filelog=l) + for p, n, l in pl if n != nullid] + class filectx(basefilectx): """A filecontext object makes access to data related to a particular filerevision convenient.""" @@ -623,18 +635,6 @@ pass return renamed - def parents(self): - p = self._path - fl = self._filelog - pl = [(p, n, fl) for n in self._filelog.parents(self._filenode)] - - r = self._filelog.renamed(self._filenode) - if r: - pl[0] = (r[0], r[1], None) - - return [filectx(self._repo, p, fileid=n, filelog=l) - for p, n, l in pl if n != nullid] - def p1(self): return self.parents()[0]