equal
deleted
inserted
replaced
228 dstbase = os.path.dirname(f) |
228 dstbase = os.path.dirname(f) |
229 if dstbase and not dstvfs.exists(dstbase): |
229 if dstbase and not dstvfs.exists(dstbase): |
230 dstvfs.mkdir(dstbase) |
230 dstvfs.mkdir(dstbase) |
231 if srcvfs.exists(f): |
231 if srcvfs.exists(f): |
232 if f.endswith('data'): |
232 if f.endswith('data'): |
|
233 # 'dstbase' may be empty (e.g. revlog format 0) |
|
234 lockfile = os.path.join(dstbase, "lock") |
233 # lock to avoid premature writing to the target |
235 # lock to avoid premature writing to the target |
234 destlock = lock.lock(dstvfs, dstbase + "/lock") |
236 destlock = lock.lock(dstvfs, lockfile) |
235 hardlink, n = util.copyfiles(srcvfs.join(f), dstvfs.join(f), |
237 hardlink, n = util.copyfiles(srcvfs.join(f), dstvfs.join(f), |
236 hardlink) |
238 hardlink) |
237 num += n |
239 num += n |
238 if hardlink: |
240 if hardlink: |
239 ui.debug("linked %d files\n" % num) |
241 ui.debug("linked %d files\n" % num) |