Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/logcmdutil.py @ 43811:29adf0a087a1
merge with stable
author | Augie Fackler <augie@google.com> |
---|---|
date | Thu, 05 Dec 2019 11:15:19 -0500 |
parents | faa8a59f4a06 d1b9d2c6ec96 |
children | 6331a6fc3304 |
comparison
equal
deleted
inserted
replaced
43810:765a9c299c44 | 43811:29adf0a087a1 |
---|---|
943 _(b'cannot follow file not in parent revision: "%s"') % fname | 943 _(b'cannot follow file not in parent revision: "%s"') % fname |
944 ) | 944 ) |
945 fctx = wctx.filectx(fname) | 945 fctx = wctx.filectx(fname) |
946 for fctx, linerange in dagop.blockancestors(fctx, fromline, toline): | 946 for fctx, linerange in dagop.blockancestors(fctx, fromline, toline): |
947 rev = fctx.introrev() | 947 rev = fctx.introrev() |
948 if rev is None: | |
949 rev = wdirrev | |
948 if rev not in userrevs: | 950 if rev not in userrevs: |
949 continue | 951 continue |
950 linerangesbyrev.setdefault(rev, {}).setdefault( | 952 linerangesbyrev.setdefault(rev, {}).setdefault( |
951 fctx.path(), [] | 953 fctx.path(), [] |
952 ).append(linerange) | 954 ).append(linerange) |
953 | 955 |
954 def nofilterhunksfn(fctx, hunks): | 956 def nofilterhunksfn(fctx, hunks): |
955 return hunks | 957 return hunks |
956 | 958 |
957 def hunksfilter(ctx): | 959 def hunksfilter(ctx): |
958 fctxlineranges = linerangesbyrev.get(ctx.rev()) | 960 fctxlineranges = linerangesbyrev.get(scmutil.intrev(ctx)) |
959 if fctxlineranges is None: | 961 if fctxlineranges is None: |
960 return nofilterhunksfn | 962 return nofilterhunksfn |
961 | 963 |
962 def filterfn(fctx, hunks): | 964 def filterfn(fctx, hunks): |
963 lineranges = fctxlineranges.get(fctx.path()) | 965 lineranges = fctxlineranges.get(fctx.path()) |
973 yield hunk | 975 yield hunk |
974 | 976 |
975 return filterfn | 977 return filterfn |
976 | 978 |
977 def filematcher(ctx): | 979 def filematcher(ctx): |
978 files = list(linerangesbyrev.get(ctx.rev(), [])) | 980 files = list(linerangesbyrev.get(scmutil.intrev(ctx), [])) |
979 return scmutil.matchfiles(repo, files) | 981 return scmutil.matchfiles(repo, files) |
980 | 982 |
981 revs = sorted(linerangesbyrev, reverse=True) | 983 revs = sorted(linerangesbyrev, reverse=True) |
982 | 984 |
983 differ = changesetdiffer() | 985 differ = changesetdiffer() |