Mutate the current entry to ensure that we are making the smallest amount of
        changes possible to the existing lockfile -- this will keep the old locked
        versions of packages if they satisfy new constraints.

        :return: None

def ensure_least_updates_possible(self):
        """
        Mutate the current entry to ensure that we are making the smallest amount of
        changes possible to the existing lockfile -- this will keep the old locked
        versions of packages if they satisfy new constraints.

        :return: None
        """
        constraints = self.get_constraints()
        can_use_original = True
        can_use_updated = True
        satisfied_by_versions = set()
        for constraint in constraints:
            if not constraint.specifier.contains(self.original_version):
                self.can_use_original = False
            if not constraint.specifier.contains(self.updated_version):
                self.can_use_updated = False
            satisfied_by_value = getattr(constraint, "satisfied_by", None)
            if satisfied_by_value:
                satisfied_by = "{0}".format(
                    self.clean_specifier(str(satisfied_by_value.version))
                )
                satisfied_by_versions.add(satisfied_by)
        if can_use_original:
            self.entry_dict = self.lockfile_dict.copy()
        elif can_use_updated:
            if len(satisfied_by_versions) == 1:
                self.entry_dict["version"] = next(iter(
                    sat_by for sat_by in satisfied_by_versions if sat_by
                ), None)
                hashes = None
                if self.lockfile_entry.specifiers == satisfied_by:
                    ireq = self.lockfile_entry.as_ireq()
                    if not self.lockfile_entry.hashes and self.resolver._should_include_hash(ireq):
                        hashes = self.resolver.get_hash(ireq)
                    else:
                        hashes = self.lockfile_entry.hashes
                else:
                    if self.resolver._should_include_hash(constraint):
                        hashes = self.resolver.get_hash(constraint)
                if hashes:
                    self.entry_dict["hashes"] = list(hashes)
                    self._entry.hashes = frozenset(hashes)
        else:
            # check for any parents, since they depend on this and the current
            # installed versions are not compatible with the new version, so
            # we will need to update the top level dependency if possible
            self.check_flattened_parents()