Show More
@@ -381,31 +381,30 b' def copystore(ui, srcrepo, destpath):' | |||
|
381 | 381 | try: |
|
382 | 382 | hardlink = None |
|
383 | 383 | topic = _('linking') if hardlink else _('copying') |
|
384 |
|
|
|
385 | num = 0 | |
|
386 | srcpublishing = srcrepo.publishing() | |
|
387 | srcvfs = vfsmod.vfs(srcrepo.sharedpath) | |
|
388 | dstvfs = vfsmod.vfs(destpath) | |
|
389 | for f in srcrepo.store.copylist(): | |
|
390 | if srcpublishing and f.endswith('phaseroots'): | |
|
391 | continue | |
|
392 | dstbase = os.path.dirname(f) | |
|
393 | if dstbase and not dstvfs.exists(dstbase): | |
|
394 | dstvfs.mkdir(dstbase) | |
|
395 | if srcvfs.exists(f): | |
|
396 | if f.endswith('data'): | |
|
397 | # 'dstbase' may be empty (e.g. revlog format 0) | |
|
398 | lockfile = os.path.join(dstbase, "lock") | |
|
399 | # lock to avoid premature writing to the target | |
|
400 | destlock = lock.lock(dstvfs, lockfile) | |
|
401 | hardlink, n = util.copyfiles(srcvfs.join(f), dstvfs.join(f), | |
|
402 | hardlink, progress) | |
|
403 | num += n | |
|
404 | if hardlink: | |
|
405 | ui.debug("linked %d files\n" % num) | |
|
406 | else: | |
|
407 | ui.debug("copied %d files\n" % num) | |
|
408 | progress.complete() | |
|
384 | with ui.makeprogress(topic) as progress: | |
|
385 | num = 0 | |
|
386 | srcpublishing = srcrepo.publishing() | |
|
387 | srcvfs = vfsmod.vfs(srcrepo.sharedpath) | |
|
388 | dstvfs = vfsmod.vfs(destpath) | |
|
389 | for f in srcrepo.store.copylist(): | |
|
390 | if srcpublishing and f.endswith('phaseroots'): | |
|
391 | continue | |
|
392 | dstbase = os.path.dirname(f) | |
|
393 | if dstbase and not dstvfs.exists(dstbase): | |
|
394 | dstvfs.mkdir(dstbase) | |
|
395 | if srcvfs.exists(f): | |
|
396 | if f.endswith('data'): | |
|
397 | # 'dstbase' may be empty (e.g. revlog format 0) | |
|
398 | lockfile = os.path.join(dstbase, "lock") | |
|
399 | # lock to avoid premature writing to the target | |
|
400 | destlock = lock.lock(dstvfs, lockfile) | |
|
401 | hardlink, n = util.copyfiles(srcvfs.join(f), dstvfs.join(f), | |
|
402 | hardlink, progress) | |
|
403 | num += n | |
|
404 | if hardlink: | |
|
405 | ui.debug("linked %d files\n" % num) | |
|
406 | else: | |
|
407 | ui.debug("copied %d files\n" % num) | |
|
409 | 408 | return destlock |
|
410 | 409 | except: # re-raises |
|
411 | 410 | release(destlock) |
General Comments 0
You need to be logged in to leave comments.
Login now