730
730
# no lines outside of insertion blocks, that deletions are
731
731
# properly paired, etc.
733
def _join(self, other, pb, msg, version_ids):
733
def _join(self, other, pb, msg, version_ids, ignore_missing):
734
734
"""Worker routine for join()."""
735
735
if not other.versions():
736
736
return # nothing to update, easy
739
739
for version_id in version_ids:
740
if not self.has_version(version_id):
740
if not self.has_version(version_id) and not ignore_missing:
741
741
raise RevisionNotPresent(version_id, self._weave_name)
742
assert version_ids == None
743
version_ids = other.versions()
744
745
# two loops so that we do not change ourselves before verifying it
746
747
# work through in index order to make sure we get all dependencies
747
748
names_to_join = []
749
for other_idx, name in enumerate(other._names):
750
version_ids = set(other.versions()).intersection(set(version_ids))
751
pending_graph = [(version, other.get_parents(version)) for
752
version in version_ids]
753
for name in topo_sort(pending_graph):
754
other_idx = other._name_map[name]
750
755
self._check_version_consistent(other, other_idx, name)
751
756
sha1 = other._sha1s[other_idx]
893
898
"""See VersionedFile.get_suffixes()."""
894
899
return [WeaveFile.WEAVE_SUFFIX]
896
def join(self, other, pb=None, msg=None, version_ids=None):
901
def join(self, other, pb=None, msg=None, version_ids=None,
902
ignore_missing=False):
897
903
"""Join other into self and save."""
898
super(WeaveFile, self).join(other, pb, msg, version_ids)
904
super(WeaveFile, self).join(other, pb, msg, version_ids, ignore_missing)
1221
1227
except AttributeError:
1224
def join(self, pb=None, msg=None, version_ids=None):
1230
def join(self, pb=None, msg=None, version_ids=None, ignore_missing=False):
1225
1231
"""See InterVersionedFile.join."""
1227
self.target._join(self.source, pb, msg, version_ids)
1233
self.target._join(self.source, pb, msg, version_ids, ignore_missing)
1228
1234
except errors.WeaveParentMismatch:
1229
1235
self.target._reweave(self.source, pb, msg)