[docs]defchanged_bytes(self,other,**kwargs)->Optional[Set[int]]:candidates:Set[int]=set()self_history_list=[self]+list(self.parents())other_history_list=[other]+list(other.parents())ifself_history_listandother_history_listandself_history_list[-1]isother_history_list[-1]:# two pages have the same root. we can get a list of candidate offsets this way# find the common ancestori=len(self_history_list)-1j=len(other_history_list)-1whilei>=0andj>=0:ifself_history_list[i]isnotother_history_list[j]:breaki-=1j-=1forpage_inself_history_list[:i+1]:forseginpage_._changed_offsets._list:candidates.update(range(seg.start,seg.end))forpage_inother_history_list[:j+1]:forseginpage_._changed_offsets._list:candidates.update(range(seg.start,seg.end))returncandidatesreturnNone