108
108
Limbo is a temporary directory use to hold new versions of files.
109
Files are added to limbo by new_file, new_directory, new_symlink, and their
110
convenience variants (create_*). Files may be removed from limbo using
111
cancel_creation. Files are renamed from limbo into their final location as
112
part of TreeTransform.apply
109
Files are added to limbo by create_file, create_directory, create_symlink,
110
and their convenience variants (new_*). Files may be removed from limbo
111
using cancel_creation. Files are renamed from limbo into their final
112
location as part of TreeTransform.apply
114
114
Limbo must be cleaned up, by either calling TreeTransform.apply or
115
115
calling TreeTransform.finalize.
117
117
Files are placed into limbo inside their parent directories, where
118
118
possible. This reduces subsequent renames, and makes operations involving
119
lots of files faster. This is only possible if the parent directory
120
is created *before* creating any of its children.
119
lots of files faster. This optimization is only possible if the parent
120
directory is created *before* creating any of its children, so avoid
121
creating children before parents, where possible.
124
125
This temporary directory is used by _FileMover for storing files that are
125
about to be deleted. FileMover does not delete files until it is
126
sure that a rollback will not happen. In case of rollback, the files
126
about to be deleted. In case of rollback, the files will be restored.
127
FileMover does not delete files until it is sure that a rollback will not
129
130
def __init__(self, tree, pb=DummyProgress()):
130
131
"""Note: a tree_write lock is taken on the tree.