Mercurial > public > mercurial-scm > hg-stable
diff mercurial/context.py @ 34434:2f5a135b2b04
annotate: track whether a particular annotation was the result of a skip
We're going to expose this information in the UI in an upcoming patch.
Differential Revision: https://phab.mercurial-scm.org/D899
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Mon, 02 Oct 2017 02:34:47 -0700 |
parents | 2e32c6a31cc7 |
children | 99c3dee3f6ce |
line wrap: on
line diff
--- a/mercurial/context.py Mon Oct 02 02:34:47 2017 -0700 +++ b/mercurial/context.py Mon Oct 02 02:34:47 2017 -0700 @@ -1111,6 +1111,8 @@ class annotateline(object): fctx = attr.ib() lineno = attr.ib(default=False) + # Whether this annotation was the result of a skip-annotate. + skip = attr.ib(default=False) def _annotatepair(parents, childfctx, child, skipchild, diffopts): r''' @@ -1159,7 +1161,7 @@ for bk in xrange(b1, b2): if child[0][bk].fctx == childfctx: ak = min(a1 + (bk - b1), a2 - 1) - child[0][bk] = parent[0][ak] + child[0][bk] = attr.evolve(parent[0][ak], skip=True) else: remaining[idx][1].append((a1, a2, b1, b2)) @@ -1170,7 +1172,7 @@ for bk in xrange(b1, b2): if child[0][bk].fctx == childfctx: ak = min(a1 + (bk - b1), a2 - 1) - child[0][bk] = parent[0][ak] + child[0][bk] = attr.evolve(parent[0][ak], skip=True) return child class filectx(basefilectx):