Mercurial > hg-stable
changeset 19704:bad0bd99ac96
commitablefilectx: move parents from workingfilectx
author | Sean Farley <sean.michael.farley@gmail.com> |
---|---|
date | Thu, 15 Aug 2013 13:42:33 -0500 |
parents | d2936bec530b |
children | 79792c8ea6da |
files | mercurial/context.py |
diffstat | 1 files changed, 18 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/context.py Thu Aug 15 13:23:06 2013 -0500 +++ b/mercurial/context.py Thu Aug 15 13:42:33 2013 -0500 @@ -1205,24 +1205,6 @@ def __nonzero__(self): return True -class workingfilectx(commitablefilectx): - """A workingfilectx object makes access to data related to a particular - file in the working directory convenient.""" - def __init__(self, repo, path, filelog=None, workingctx=None): - super(workingfilectx, self).__init__(repo, path, filelog, workingctx) - - @propertycache - def _changectx(self): - return workingctx(self._repo) - - def data(self): - return self._repo.wread(self._path) - def renamed(self): - rp = self._repo.dirstate.copied(self._path) - if not rp: - return None - return rp, self._changectx._parents[0]._manifest.get(rp, nullid) - def parents(self): '''return parent filectxs, following copies if necessary''' def filenode(ctx, path): @@ -1244,6 +1226,24 @@ return [filectx(self._repo, p, fileid=n, filelog=l) for p, n, l in pl if n != nullid] +class workingfilectx(commitablefilectx): + """A workingfilectx object makes access to data related to a particular + file in the working directory convenient.""" + def __init__(self, repo, path, filelog=None, workingctx=None): + super(workingfilectx, self).__init__(repo, path, filelog, workingctx) + + @propertycache + def _changectx(self): + return workingctx(self._repo) + + def data(self): + return self._repo.wread(self._path) + def renamed(self): + rp = self._repo.dirstate.copied(self._path) + if not rp: + return None + return rp, self._changectx._parents[0]._manifest.get(rp, nullid) + def children(self): return []