public function rebaseDiff(Node $node)
    {
        $changes = array_merge(
            $node->getDiffAdditions(),
            $node->getDiffDeletions(),
            $node->getDiffReplacements()
        );
        if (count($changes) > 0) {
            throw new RebaseException(
                sprintf(
                    '%s has some uncommitted changes - Cannot rebase %s on %s',
                    $node->getDn(),
                    $this->getDn(),
                    $node->getDn()
                )
            );
        }
        $additions = $this->getDiffAdditions();
        $deletions = $this->getDiffDeletions();
        $replacements = $this->getDiffReplacements();
        $this->snapshot();
        $this->attributes = $node->getAttributes();
        foreach ($additions as $attribute => $values) {
            $this->get($attribute, true)->add($values);
        }
        foreach ($deletions as $attribute => $values) {
            if (count($values) == 0) {
                $this->removeAttribute($attribute);
            } else {
                if ($this->has($attribute)) {
                    $this->get($attribute)->remove($values);
                }
            }
        }
        foreach ($replacements as $attribute => $values) {
            $this->get($attribute, true)->set($values);
        }
    }