comparison mercurial/context.py @ 31076:0e07855e6054

context: also return ancestor's line range in blockancestors
author Denis Laxalde <denis.laxalde@logilab.fr>
date Mon, 16 Jan 2017 17:14:36 +0100
parents 21f1f97ab212
children c414e339e7af
comparison
equal deleted inserted replaced
31075:21f1f97ab212 31076:0e07855e6054
1177 pl = c.parents() 1177 pl = c.parents()
1178 if followfirst: 1178 if followfirst:
1179 pl = pl[:1] 1179 pl = pl[:1]
1180 if not pl: 1180 if not pl:
1181 # The block originates from the initial revision. 1181 # The block originates from the initial revision.
1182 yield c 1182 yield c, linerange2
1183 continue 1183 continue
1184 inrange = False 1184 inrange = False
1185 for p in pl: 1185 for p in pl:
1186 inrangep, linerange1 = _changesrange(p, c, linerange2, diffopts) 1186 inrangep, linerange1 = _changesrange(p, c, linerange2, diffopts)
1187 inrange = inrange or inrangep 1187 inrange = inrange or inrangep
1190 # introduced in this revision; no need to go futher in this 1190 # introduced in this revision; no need to go futher in this
1191 # branch. 1191 # branch.
1192 continue 1192 continue
1193 visit[p.linkrev(), p.filenode()] = p, linerange1 1193 visit[p.linkrev(), p.filenode()] = p, linerange1
1194 if inrange: 1194 if inrange:
1195 yield c 1195 yield c, linerange2
1196 1196
1197 class committablectx(basectx): 1197 class committablectx(basectx):
1198 """A committablectx object provides common functionality for a context that 1198 """A committablectx object provides common functionality for a context that
1199 wants the ability to commit, e.g. workingctx or memctx.""" 1199 wants the ability to commit, e.g. workingctx or memctx."""
1200 def __init__(self, repo, text="", user=None, date=None, extra=None, 1200 def __init__(self, repo, text="", user=None, date=None, extra=None,