def synchronize_tree(self, node):
        "Find the current directory state and update the tree."
        # Build a new SizeTree to find the result.
        tree = discover.SizeTree(node.path)
        self.begin_rm_update(tree.total_nodes)
        # Record the difference and patch the Viewtree.
        diff = tree.total_size - node.total_size
        self.patch_tree(node, tree)
        # Fix all parent nodes with the correct size.
        self.update_parents(node.parent, diff)
        self.end_rm()
Find the current directory state and update the tree.
recipes/Python/577635_Directory_Pruner_3/recipe-577635.py