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