equal
deleted
inserted
replaced
211 dstbase = os.path.dirname(f) |
211 dstbase = os.path.dirname(f) |
212 if dstbase and not dstvfs.exists(dstbase): |
212 if dstbase and not dstvfs.exists(dstbase): |
213 dstvfs.mkdir(dstbase) |
213 dstvfs.mkdir(dstbase) |
214 if srcvfs.exists(f): |
214 if srcvfs.exists(f): |
215 if f.endswith('data'): |
215 if f.endswith('data'): |
|
216 # 'dstbase' may be empty (e.g. revlog format 0) |
|
217 lockfile = os.path.join(dstbase, "lock") |
216 # lock to avoid premature writing to the target |
218 # lock to avoid premature writing to the target |
217 destlock = lock.lock(dstvfs, dstbase + "/lock") |
219 destlock = lock.lock(dstvfs, lockfile) |
218 hardlink, n = util.copyfiles(srcvfs.join(f), dstvfs.join(f), |
220 hardlink, n = util.copyfiles(srcvfs.join(f), dstvfs.join(f), |
219 hardlink) |
221 hardlink) |
220 num += n |
222 num += n |
221 if hardlink: |
223 if hardlink: |
222 ui.debug("linked %d files\n" % num) |
224 ui.debug("linked %d files\n" % num) |