Show More
@@ -680,8 +680,7 b' class basefilectx(object):' | |||
|
680 | 680 | elif '_descendantrev' in self.__dict__: |
|
681 | 681 | # this file context was created from a revision with a known |
|
682 | 682 | # descendant, we can (lazily) correct for linkrev aliases |
|
683 |
return self._adjustlinkrev(self._ |
|
|
684 | self._filenode, self._descendantrev) | |
|
683 | return self._adjustlinkrev(self._descendantrev) | |
|
685 | 684 | else: |
|
686 | 685 | return self._filelog.linkrev(self._filerev) |
|
687 | 686 | |
@@ -811,17 +810,13 b' class basefilectx(object):' | |||
|
811 | 810 | |
|
812 | 811 | return True |
|
813 | 812 | |
|
814 |
def _adjustlinkrev(self |
|
|
813 | def _adjustlinkrev(self, srcrev, inclusive=False): | |
|
815 | 814 | """return the first ancestor of <srcrev> introducing <fnode> |
|
816 | 815 | |
|
817 | 816 | If the linkrev of the file revision does not point to an ancestor of |
|
818 | 817 | srcrev, we'll walk down the ancestors until we find one introducing |
|
819 | 818 | this file revision. |
|
820 | 819 | |
|
821 | :repo: a localrepository object (used to access changelog and manifest) | |
|
822 | :path: the file path | |
|
823 | :fnode: the nodeid of the file revision | |
|
824 | :filelog: the filelog of this path | |
|
825 | 820 | :srcrev: the changeset revision we search ancestors from |
|
826 | 821 | :inclusive: if true, the src revision will also be checked |
|
827 | 822 | """ |
@@ -829,8 +824,7 b' class basefilectx(object):' | |||
|
829 | 824 | cl = repo.unfiltered().changelog |
|
830 | 825 | mfl = repo.manifestlog |
|
831 | 826 | # fetch the linkrev |
|
832 |
|
|
|
833 | lkr = filelog.linkrev(fr) | |
|
827 | lkr = self.linkrev() | |
|
834 | 828 | # hack to reuse ancestor computation when searching for renames |
|
835 | 829 | memberanc = getattr(self, '_ancestrycontext', None) |
|
836 | 830 | iteranc = None |
@@ -847,6 +841,8 b' class basefilectx(object):' | |||
|
847 | 841 | if lkr not in memberanc: |
|
848 | 842 | if iteranc is None: |
|
849 | 843 | iteranc = cl.ancestors(revs, lkr, inclusive=inclusive) |
|
844 | fnode = self._filenode | |
|
845 | path = self._path | |
|
850 | 846 | for a in iteranc: |
|
851 | 847 | ac = cl.read(a) # get changeset data (we avoid object creation) |
|
852 | 848 | if path in ac[3]: # checking the 'files' field. |
@@ -874,8 +870,7 b' class basefilectx(object):' | |||
|
874 | 870 | noctx = not ('_changeid' in attrs or '_changectx' in attrs) |
|
875 | 871 | if noctx or self.rev() == lkr: |
|
876 | 872 | return self.linkrev() |
|
877 |
return self._adjustlinkrev(self. |
|
|
878 | self.rev(), inclusive=True) | |
|
873 | return self._adjustlinkrev(self.rev(), inclusive=True) | |
|
879 | 874 | |
|
880 | 875 | def _parentfilectx(self, path, fileid, filelog): |
|
881 | 876 | """create parent filectx keeping ancestry info for _adjustlinkrev()""" |
General Comments 0
You need to be logged in to leave comments.
Login now