diff -r c57c9cece645 -r dda11e799529 mercurial/hg.py --- a/mercurial/hg.py Mon Mar 24 21:27:40 2014 -0400 +++ b/mercurial/hg.py Tue Mar 25 19:34:17 2014 +0900 @@ -213,8 +213,10 @@ dstvfs.mkdir(dstbase) if srcvfs.exists(f): if f.endswith('data'): + # 'dstbase' may be empty (e.g. revlog format 0) + lockfile = os.path.join(dstbase, "lock") # lock to avoid premature writing to the target - destlock = lock.lock(dstvfs, dstbase + "/lock") + destlock = lock.lock(dstvfs, lockfile) hardlink, n = util.copyfiles(srcvfs.join(f), dstvfs.join(f), hardlink) num += n