changeset 1208:4644df4944ff

Clean up local clone file list We now use an explicit list of files to copy during clone so that we don't copy anything we shouldn't.
author mpm@selenic.com
date Wed, 07 Sep 2005 19:30:23 -0700
parents a7b8812973d9
children 920682a532df
files mercurial/commands.py
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Wed Sep 07 19:21:38 2005 -0700
+++ b/mercurial/commands.py	Wed Sep 07 19:30:23 2005 -0700
@@ -604,17 +604,17 @@
                     and getattr(os, 'link', None) or shutil.copy2)
         if copyfile is not shutil.copy2:
             ui.note("cloning by hardlink\n")
+
         # we use a lock here because because we're not nicely ordered
         l = lock.lock(os.path.join(source, ".hg", "lock"))
 
-        util.copyfiles(os.path.join(source, ".hg"), os.path.join(dest, ".hg"),
-                      copyfile)
+        os.mkdir(os.path.join(dest, ".hg"))
 
-        for fn in "dirstate", "lock", "hgrc", "localtags":
-            try:
-                os.unlink(os.path.join(dest, ".hg", fn))
-            except OSError:
-                pass
+        files = "data 00manifest.d 00manifest.i 00changelog.d 00changelog.i"
+        for f in files.split():
+            src = os.path.join(source, ".hg", f)
+            dst = os.path.join(dest, ".hg", f)
+            util.copyfiles(src, dst, copyfile)
 
         repo = hg.repository(ui, dest)