comparison mercurial/commands.py @ 1207:a7b8812973d9

Rewrite copytree as copyfiles This inverts the logic of copytree to allow copying single files at the top level.
author mpm@selenic.com
date Wed, 07 Sep 2005 19:21:38 -0700
parents 6512d352d6c1
children 4644df4944ff
comparison
equal deleted inserted replaced
1206:6512d352d6c1 1207:a7b8812973d9
605 if copyfile is not shutil.copy2: 605 if copyfile is not shutil.copy2:
606 ui.note("cloning by hardlink\n") 606 ui.note("cloning by hardlink\n")
607 # we use a lock here because because we're not nicely ordered 607 # we use a lock here because because we're not nicely ordered
608 l = lock.lock(os.path.join(source, ".hg", "lock")) 608 l = lock.lock(os.path.join(source, ".hg", "lock"))
609 609
610 util.copytree(os.path.join(source, ".hg"), os.path.join(dest, ".hg"), 610 util.copyfiles(os.path.join(source, ".hg"), os.path.join(dest, ".hg"),
611 copyfile) 611 copyfile)
612 612
613 for fn in "dirstate", "lock", "hgrc", "localtags": 613 for fn in "dirstate", "lock", "hgrc", "localtags":
614 try: 614 try:
615 os.unlink(os.path.join(dest, ".hg", fn)) 615 os.unlink(os.path.join(dest, ".hg", fn))