# HG changeset patch # User mpm@selenic.com # Date 1126146623 25200 # Node ID 4644df4944ffa661f54128b9e7bee3472bcf98c3 # Parent a7b8812973d940d33461d2b59c559310877affbc 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. diff -r a7b8812973d9 -r 4644df4944ff mercurial/commands.py --- 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)