diff -r 3210b7930899 -r 9a09a625bc93 mercurial/hg.py --- a/mercurial/hg.py Mon Mar 24 20:00:18 2014 -0700 +++ b/mercurial/hg.py Tue Mar 25 16:17:16 2014 -0500 @@ -230,8 +230,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