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.
--- 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)