##// END OF EJS Templates
context: add a followfirst flag to blockancestors
Denis Laxalde -
r31075:21f1f97a default
parent child Browse files
Show More
@@ -1166,7 +1166,7 b' def _changesrange(fctx1, fctx2, linerang'
1166 diffinrange = any(stype == '!' for _, stype in filteredblocks)
1166 diffinrange = any(stype == '!' for _, stype in filteredblocks)
1167 return diffinrange, linerange1
1167 return diffinrange, linerange1
1168
1168
1169 def blockancestors(fctx, fromline, toline):
1169 def blockancestors(fctx, fromline, toline, followfirst=False):
1170 """Yield ancestors of `fctx` with respect to the block of lines within
1170 """Yield ancestors of `fctx` with respect to the block of lines within
1171 `fromline`-`toline` range.
1171 `fromline`-`toline` range.
1172 """
1172 """
@@ -1175,6 +1175,8 b' def blockancestors(fctx, fromline, tolin'
1175 while visit:
1175 while visit:
1176 c, linerange2 = visit.pop(max(visit))
1176 c, linerange2 = visit.pop(max(visit))
1177 pl = c.parents()
1177 pl = c.parents()
1178 if followfirst:
1179 pl = pl[:1]
1178 if not pl:
1180 if not pl:
1179 # The block originates from the initial revision.
1181 # The block originates from the initial revision.
1180 yield c
1182 yield c
General Comments 0
You need to be logged in to leave comments. Login now