Mercurial > public > mercurial-scm > hg
diff mercurial/context.py @ 37065:b235bde38a83
annotate: drop linenumber flag from fctx.annotate() (API)
Now linenumber=True is fast enough to be enabled by default.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Tue, 13 Mar 2018 22:18:06 +0900 |
parents | 5d3abd6a5b25 |
children | b33b91ca2ec2 |
line wrap: on
line diff
--- a/mercurial/context.py Mon Mar 12 20:45:10 2018 +0900 +++ b/mercurial/context.py Tue Mar 13 22:18:06 2018 +0900 @@ -967,14 +967,13 @@ return p[1] return filectx(self._repo, self._path, fileid=-1, filelog=self._filelog) - def annotate(self, follow=False, linenumber=False, skiprevs=None, - diffopts=None): - '''returns a list of tuples of ((ctx, number), line) for each line - in the file, where ctx is the filectx of the node where - that line was last changed; if linenumber parameter is true, number is - the line number at the first appearance in the managed file, otherwise, - number has a fixed value of False. - ''' + def annotate(self, follow=False, skiprevs=None, diffopts=None): + """Returns a list of tuples of (attr, line) for each line in the file + + - attr.fctx is the filectx of the node where that line was last changed + - attr.lineno is the line number at the first appearance in the managed + file + """ getlog = util.lrucachefunc(lambda x: self._repo.file(x)) def parents(f): @@ -1010,8 +1009,8 @@ ac = cl.ancestors([base.rev()], inclusive=True) base._ancestrycontext = ac - return dagop.annotate(base, parents, linenumber=linenumber, - skiprevs=skiprevs, diffopts=diffopts) + return dagop.annotate(base, parents, skiprevs=skiprevs, + diffopts=diffopts) def ancestors(self, followfirst=False): visit = {}