Skip to content

Commit 33570cb

Browse files
committed
Add comments explaining the dual copy technique
1 parent da883f6 commit 33570cb

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎path.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,12 +1372,16 @@ def merge_tree(self, dst, *args, **kwargs):
13721372
"""
13731373
update = kwargs.pop('update', False)
13741374
with tempdir() as _temp_dir:
1375+
# first copy the tree to a stage directory to support
1376+
# the parameters and behavior of copytree.
13751377
stage = _temp_dir / str(hash(self))
13761378
self.copytree(stage, *args, **kwargs)
13771379
if len(args):
13781380
symlinks = args[0]
13791381
else:
13801382
symlinks = kwargs.get('symlinks', False)
1383+
# now copy everything from the stage directory using
1384+
# the semantics of dir_util.copy_tree
13811385
dir_util.copy_tree(stage, dst, preserve_symlinks=int(symlinks),
13821386
update=int(update))
13831387

0 commit comments

Comments
 (0)