Mercurial > hg
changeset 19605:cf7322cb1c13
basefilectx: move parents from filectx
author | Sean Farley <sean.michael.farley@gmail.com> |
---|---|
date | Sun, 11 Aug 2013 22:57:21 -0500 |
parents | ef7c47e4002f |
children | 284f91230c07 |
files | mercurial/context.py |
diffstat | 1 files changed, 12 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- 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]