Mercurial > public > mercurial-scm > hg-stable
diff mercurial/context.py @ 3146:e69a0cbe268e
filectx.annotate: return filectx for each line instead of rev
author | Brendan Cully <brendan@kublai.com> |
---|---|
date | Fri, 22 Sep 2006 08:19:25 -0700 |
parents | 8342ad5abe0b |
children | ff1ab08e6732 |
line wrap: on
line diff
--- a/mercurial/context.py Fri Sep 22 08:19:25 2006 -0700 +++ b/mercurial/context.py Fri Sep 22 08:19:25 2006 -0700 @@ -7,7 +7,7 @@ from node import * from demandload import demandload -demandload(globals(), "ancestor") +demandload(globals(), "ancestor util") class changectx(object): """A changecontext object makes access to data related to a particular @@ -155,7 +155,12 @@ filelog=self._filelog) for x in c ] def annotate(self): - return self._filelog.annotate(self._filenode) + getctx = util.cachefunc(lambda x: filectx(self._repo, self._path, + changeid=x, + filelog=self._filelog)) + hist = self._filelog.annotate(self._filenode) + + return [(getctx(rev), line) for rev, line in hist] def ancestor(self, fc2): """