##// END OF EJS Templates
linkrev-filelog: handle filtered linkrev with no visible children (issue4307)...
Pierre-Yves David -
r23720:8ec03e0e default
parent child Browse files
Show More
@@ -792,6 +792,7 b' def filelog(repo, subset, x):'
792 backrevref = {} # final value for: changerev -> filerev
792 backrevref = {} # final value for: changerev -> filerev
793 lowestchild = {} # lowest known filerev child of a filerev
793 lowestchild = {} # lowest known filerev child of a filerev
794 delayed = [] # filerev with filtered linkrev, for post-processing
794 delayed = [] # filerev with filtered linkrev, for post-processing
795 lowesthead = None # cache for manifest content of all head revisions
795 fl = repo.file(f)
796 fl = repo.file(f)
796 for fr in list(fl):
797 for fr in list(fl):
797 lkr = rev = fl.linkrev(fr)
798 lkr = rev = fl.linkrev(fr)
@@ -825,9 +826,24 b' def filelog(repo, subset, x):'
825 child = lowestchild.get(fr)
826 child = lowestchild.get(fr)
826
827
827 if child is None:
828 if child is None:
828 # XXX content could be linkrev-shadowed in a head, but lets
829 # search for existence of this file revision in a head revision.
829 # ignore this case for now.
830 # There are three possibilities:
830 continue
831 # - the revision exists in a head and we can find an
832 # introduction from there,
833 # - the revision does not exist in a head because it has been
834 # changed since its introduction: we would have found a child
835 # and be in the other 'else' clause,
836 # - all versions of the revision are hidden.
837 if lowesthead is None:
838 lowesthead = {}
839 for h in repo.heads():
840 fnode = repo[h].manifest()[f]
841 lowesthead[fl.rev(fnode)] = h
842 headrev = lowesthead.get(fr)
843 if headrev is None:
844 # content is nowhere unfiltered
845 continue
846 rev = repo[headrev][f].introrev()
831 else:
847 else:
832 # the lowest known child is a good upper bound
848 # the lowest known child is a good upper bound
833 childcrev = backrevref[child]
849 childcrev = backrevref[child]
@@ -1725,4 +1725,22 b' Check that log on the file does not drop'
1725 summary: content1
1725 summary: content1
1726
1726
1727
1727
1728 Even when a head revision is linkrev-shadowed.
1729
1730 $ hg log -T '{node}\n' -r 4
1731 50b9b36e9c5df2c6fc6dcefa8ad0da929e84aed2
1732 $ hg debugobsolete 50b9b36e9c5df2c6fc6dcefa8ad0da929e84aed2
1733 $ hg log -G a
1734 @ changeset: 3:15b2327059e5
1735 | tag: tip
1736 | user: test
1737 | date: Thu Jan 01 00:00:00 1970 +0000
1738 | summary: content2
1739 |
1740 o changeset: 0:ae0a3c9f9e95
1741 user: test
1742 date: Thu Jan 01 00:00:00 1970 +0000
1743 summary: content1
1744
1745
1728 $ cd ..
1746 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now