Mercurial > hg
changeset 1209:920682a532df
Tighten up clone locking
Add a lock on the destination, expand comment on source lock
author | mpm@selenic.com |
---|---|
date | Wed, 07 Sep 2005 19:37:11 -0700 |
parents | 4644df4944ff |
children | 27f2ec705332 |
files | mercurial/commands.py |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/commands.py Wed Sep 07 19:30:23 2005 -0700 +++ b/mercurial/commands.py Wed Sep 07 19:37:11 2005 -0700 @@ -605,10 +605,14 @@ 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")) + # we use a lock here because if we race with commit, we can + # end up with extra data in the cloned revlogs that's not + # pointed to by changesets, thus causing verify to fail + l1 = lock.lock(os.path.join(source, ".hg", "lock")) + # and here to avoid premature writing to the target os.mkdir(os.path.join(dest, ".hg")) + l2 = lock.lock(os.path.join(dest, ".hg", "lock")) files = "data 00manifest.d 00manifest.i 00changelog.d 00changelog.i" for f in files.split():