Show More
@@ -851,25 +851,45 b' class hgtagsfnodescache:' | |||||
851 | rev = ctx.rev() |
|
851 | rev = ctx.rev() | |
852 | fnode = None |
|
852 | fnode = None | |
853 | cl = self._repo.changelog |
|
853 | cl = self._repo.changelog | |
|
854 | ml = self._repo.manifestlog | |||
|
855 | mctx = ctx.manifestctx() | |||
|
856 | base_values = {} | |||
854 | p1rev, p2rev = cl._uncheckedparentrevs(rev) |
|
857 | p1rev, p2rev = cl._uncheckedparentrevs(rev) | |
855 | p1node = cl.node(p1rev) |
|
858 | m_p1_node, m_p2_node = mctx.parents | |
856 | p1fnode = self.getfnode(p1node, computemissing=False) |
|
859 | if p1rev != nullrev: | |
|
860 | p1_node = cl.node(p1rev) | |||
|
861 | fnode = self.getfnode(p1_node, computemissing=False) | |||
|
862 | # when unknown, fnode is None or False | |||
|
863 | if fnode: | |||
|
864 | p1_manifest_rev = ml.rev(m_p1_node) | |||
|
865 | base_values[p1_manifest_rev] = fnode | |||
857 | if p2rev != nullrev: |
|
866 | if p2rev != nullrev: | |
858 | # There is some no-merge changeset where p1 is null and p2 is set |
|
867 | p2_node = cl.node(p2rev) | |
859 | # Processing them as merge is just slower, but still gives a good |
|
868 | fnode = self.getfnode(p2_node, computemissing=False) | |
860 | # result. |
|
869 | # when unknown, fnode is None or False | |
861 | p2node = cl.node(p2rev) |
|
870 | if fnode: | |
862 | p2fnode = self.getfnode(p2node, computemissing=False) |
|
871 | p2_manifest_rev = ml.rev(m_p2_node) | |
863 | if p1fnode != p2fnode: |
|
872 | base_values[p2_manifest_rev] = fnode | |
864 | # we cannot rely on readfast because we don't know against what |
|
873 | # XXX: Beware that using delta to speed things up here is actually | |
865 | # parent the readfast delta is computed |
|
874 | # buggy as it will fails to detect a `.hgtags` deletion. That buggy | |
866 | p1fnode = None |
|
875 | # behavior has been cargo culted from the previous version of this code | |
867 | if p1fnode: |
|
876 | # as "in practice this seems fine" and not using delta is just too | |
868 | mctx = ctx.manifestctx() |
|
877 | # slow. | |
869 | fnode = mctx.readfast().get(b'.hgtags') |
|
878 | # | |
|
879 | # However note that we only consider delta from p1 or p2 because it is | |||
|
880 | # far less likely to have a .hgtags delete in a child than missing from | |||
|
881 | # one branch to another. As the delta chain construction keep being | |||
|
882 | # optimized, it means we will not use delta as often as we could. | |||
|
883 | if base_values: | |||
|
884 | base, m = mctx.read_any_fast_delta(base_values) | |||
|
885 | fnode = m.get(b'.hgtags') | |||
870 | if fnode is None: |
|
886 | if fnode is None: | |
871 | fnode = p1fnode |
|
887 | if base is not None: | |
872 | if fnode is None: |
|
888 | fnode = base_values[base] | |
|
889 | else: | |||
|
890 | # No delta and .hgtags file on this revision. | |||
|
891 | fnode = self._repo.nullid | |||
|
892 | else: | |||
873 | # Populate missing entry. |
|
893 | # Populate missing entry. | |
874 | try: |
|
894 | try: | |
875 | fnode = ctx.filenode(b'.hgtags') |
|
895 | fnode = ctx.filenode(b'.hgtags') |
General Comments 0
You need to be logged in to leave comments.
Login now