comparison mercurial/context.py @ 37066:b33b91ca2ec2

annotate: pack line content into annotateline object (API) Just for code readability. We can do that since the annotateline type is no longer used while computing the history.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 18 Mar 2018 12:28:19 +0900
parents b235bde38a83
children f0b6fbea00cf
comparison
equal deleted inserted replaced
37065:b235bde38a83 37066:b33b91ca2ec2
966 if len(p) == 2: 966 if len(p) == 2:
967 return p[1] 967 return p[1]
968 return filectx(self._repo, self._path, fileid=-1, filelog=self._filelog) 968 return filectx(self._repo, self._path, fileid=-1, filelog=self._filelog)
969 969
970 def annotate(self, follow=False, skiprevs=None, diffopts=None): 970 def annotate(self, follow=False, skiprevs=None, diffopts=None):
971 """Returns a list of tuples of (attr, line) for each line in the file 971 """Returns a list of annotateline objects for each line in the file
972 972
973 - attr.fctx is the filectx of the node where that line was last changed 973 - line.fctx is the filectx of the node where that line was last changed
974 - attr.lineno is the line number at the first appearance in the managed 974 - line.lineno is the line number at the first appearance in the managed
975 file 975 file
976 - line.text is the data on that line (including newline character)
976 """ 977 """
977 getlog = util.lrucachefunc(lambda x: self._repo.file(x)) 978 getlog = util.lrucachefunc(lambda x: self._repo.file(x))
978 979
979 def parents(f): 980 def parents(f):
980 # Cut _descendantrev here to mitigate the penalty of lazy linkrev 981 # Cut _descendantrev here to mitigate the penalty of lazy linkrev