Show More
@@ -1111,6 +1111,8 b' class basefilectx(object):' | |||
|
1111 | 1111 | class annotateline(object): |
|
1112 | 1112 | fctx = attr.ib() |
|
1113 | 1113 | lineno = attr.ib(default=False) |
|
1114 | # Whether this annotation was the result of a skip-annotate. | |
|
1115 | skip = attr.ib(default=False) | |
|
1114 | 1116 | |
|
1115 | 1117 | def _annotatepair(parents, childfctx, child, skipchild, diffopts): |
|
1116 | 1118 | r''' |
@@ -1159,7 +1161,7 b' def _annotatepair(parents, childfctx, ch' | |||
|
1159 | 1161 | for bk in xrange(b1, b2): |
|
1160 | 1162 | if child[0][bk].fctx == childfctx: |
|
1161 | 1163 | ak = min(a1 + (bk - b1), a2 - 1) |
|
1162 | child[0][bk] = parent[0][ak] | |
|
1164 | child[0][bk] = attr.evolve(parent[0][ak], skip=True) | |
|
1163 | 1165 | else: |
|
1164 | 1166 | remaining[idx][1].append((a1, a2, b1, b2)) |
|
1165 | 1167 | |
@@ -1170,7 +1172,7 b' def _annotatepair(parents, childfctx, ch' | |||
|
1170 | 1172 | for bk in xrange(b1, b2): |
|
1171 | 1173 | if child[0][bk].fctx == childfctx: |
|
1172 | 1174 | ak = min(a1 + (bk - b1), a2 - 1) |
|
1173 | child[0][bk] = parent[0][ak] | |
|
1175 | child[0][bk] = attr.evolve(parent[0][ak], skip=True) | |
|
1174 | 1176 | return child |
|
1175 | 1177 | |
|
1176 | 1178 | class filectx(basefilectx): |
@@ -80,9 +80,11 b' class AnnotateTests(unittest.TestCase):' | |||
|
80 | 80 | diffopts) |
|
81 | 81 | self.assertEqual(childann[0], [ |
|
82 | 82 | annotateline('old', 1), |
|
83 | annotateline('old', 2), | |
|
83 | annotateline('old', 2, True), | |
|
84 | # note that this line was carried over from earlier so it is *not* | |
|
85 | # marked skipped | |
|
84 | 86 | annotateline('p2', 2), |
|
85 | annotateline('p2', 2), | |
|
87 | annotateline('p2', 2, True), | |
|
86 | 88 | annotateline('p2', 3), |
|
87 | 89 | ]) |
|
88 | 90 | |
@@ -91,9 +93,9 b' class AnnotateTests(unittest.TestCase):' | |||
|
91 | 93 | diffopts) |
|
92 | 94 | self.assertEqual(childann[0], [ |
|
93 | 95 | annotateline('old', 1), |
|
94 | annotateline('old', 2), | |
|
96 | annotateline('old', 2, True), | |
|
95 | 97 | annotateline('p1', 3), |
|
96 | annotateline('p1', 3), | |
|
98 | annotateline('p1', 3, True), | |
|
97 | 99 | annotateline('p2', 3), |
|
98 | 100 | ]) |
|
99 | 101 |
General Comments 0
You need to be logged in to leave comments.
Login now