'Compare the last saved metadata for each repository dependency in the repository
with the new metadata in self.metadata_dict to determine if a new repository_metadata
table record is required or if the last saved metadata record can be updated for
repository_dependencies instead.'

def new_repository_dependency_metadata_required(self, repository_metadata):

    if repository_metadata:
        metadata = repository_metadata.metadata
        if ('repository_dependencies' in metadata):
            saved_repository_dependencies = metadata['repository_dependencies']['repository_dependencies']
            new_repository_dependencies_metadata = self.metadata_dict.get('repository_dependencies', None)
            if new_repository_dependencies_metadata:
                new_repository_dependencies = self.metadata_dict['repository_dependencies']['repository_dependencies']
                for saved_repository_dependency in saved_repository_dependencies:
                    if (saved_repository_dependency not in new_repository_dependencies):
                        if (not self.different_revision_defines_tip_only_repository_dependency(saved_repository_dependency, new_repository_dependencies)):
                            return True
                return False
            else:
                return True
        else:
            return False
    elif ('repository_dependencies' in self.metadata_dict):
        return True
    else:
        return False
