comparison mercurial/cmdutil.py @ 34907:0ccfc468423a

log: handle removed files with --line-range patterns I.e. abort when the pattern corresponds to a removed file, as done with bare file patterns.
author Denis Laxalde <denis.laxalde@logilab.fr>
date Thu, 19 Oct 2017 14:55:10 +0200
parents 5c7dbb730179
children 362096cfdb1f
comparison
equal deleted inserted replaced
34906:2e45bbd3db7b 34907:0ccfc468423a
2625 wctx = repo[None] 2625 wctx = repo[None]
2626 2626
2627 # Two-levels map of "rev -> file ctx -> [line range]". 2627 # Two-levels map of "rev -> file ctx -> [line range]".
2628 linerangesbyrev = {} 2628 linerangesbyrev = {}
2629 for fname, (fromline, toline) in _parselinerangelogopt(repo, opts): 2629 for fname, (fromline, toline) in _parselinerangelogopt(repo, opts):
2630 if fname not in wctx:
2631 raise error.Abort(_('cannot follow file not in parent '
2632 'revision: "%s"') % fname)
2630 fctx = wctx.filectx(fname) 2633 fctx = wctx.filectx(fname)
2631 for fctx, linerange in dagop.blockancestors(fctx, fromline, toline): 2634 for fctx, linerange in dagop.blockancestors(fctx, fromline, toline):
2632 rev = fctx.introrev() 2635 rev = fctx.introrev()
2633 if rev not in userrevs: 2636 if rev not in userrevs:
2634 continue 2637 continue