mercurial/hg.py
changeset 20829 9a09a625bc93
parent 20800 8253e55930a3
parent 20825 dda11e799529
child 20860 81d6dc8c3c63
--- 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