697
697
ch_a = ch_b = False
698
# TODO: Return a structured form of the conflicts (e.g. 2-tuples for
699
# conflicted regions), rather than just inserting the markers.
701
# TODO: Show some version information (e.g. author, date) on
702
# conflicted regions.
699
703
for state, line in plan:
700
704
if state == 'unchanged' or state == 'killed-both':
701
705
# resync and flush queued conflicts changes if any
757
762
# work through in index order to make sure we get all dependencies
758
763
for other_idx, name in enumerate(other._names):
759
if self._check_version_consistent(other, other_idx, name):
764
self._check_version_consistent(other, other_idx, name)
761
769
for other_idx, name in enumerate(other._names):
762
# TODO: If all the parents of the other version are already
770
# TODO: If all the parents of the other version are already
763
771
# present then we can avoid some work by just taking the delta
764
772
# and adjusting the offsets.
765
773
new_parents = self._imported_parents(other, other_idx)
774
sha1 = other._sha1s[other_idx]
778
if name in self._names:
779
idx = self.lookup(name)
780
n1 = map(other.idx_to_name, other._parents[other_idx] )
781
n2 = map(self.idx_to_name, self._parents[other_idx] )
782
if sha1 == self._sha1s[idx] and n1 == n2:
766
786
lines = other.get_lines(other_idx)
767
sha1 = other._sha1s[other_idx]
768
787
self.add(name, new_parents, lines, sha1)
789
mutter("merged = %d, processed = %d, file_id=%s; deltat=%d"%(
790
merged,processed,self._weave_name, time.time( )-time0))
771
795
def _imported_parents(self, other, other_idx):
772
796
"""Return list of parents in self corresponding to indexes in other."""