mercurial/hg.py
branchstable
changeset 20825 dda11e799529
parent 20355 7d269e7620c4
child 20829 9a09a625bc93
child 20858 bc56ec9e64df
--- 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