##// END OF EJS Templates
lfs: restore the local blob store after a repo upgrade...
Matt Harbison -
r35364:b0ba1539 default
parent child Browse files
Show More
@@ -140,6 +140,9 b' def extsetup(ui):'
140
140
141 wrapfunction(scmutil, 'wrapconvertsink', wrapper.convertsink)
141 wrapfunction(scmutil, 'wrapconvertsink', wrapper.convertsink)
142
142
143 wrapfunction(upgrade, '_finishdatamigration',
144 wrapper.upgradefinishdatamigration)
145
143 wrapfunction(upgrade, 'preservedrequirements',
146 wrapfunction(upgrade, 'preservedrequirements',
144 wrapper.upgraderequirements)
147 wrapper.upgraderequirements)
145
148
@@ -19,6 +19,8 b' from mercurial import ('
19 util,
19 util,
20 )
20 )
21
21
22 from ..largefiles import lfutil
23
22 from . import (
24 from . import (
23 blobstore,
25 blobstore,
24 pointer,
26 pointer,
@@ -303,6 +305,17 b' def uploadblobs(repo, pointers):'
303 remoteblob = repo.svfs.lfsremoteblobstore
305 remoteblob = repo.svfs.lfsremoteblobstore
304 remoteblob.writebatch(pointers, repo.svfs.lfslocalblobstore)
306 remoteblob.writebatch(pointers, repo.svfs.lfslocalblobstore)
305
307
308 def upgradefinishdatamigration(orig, ui, srcrepo, dstrepo, requirements):
309 orig(ui, srcrepo, dstrepo, requirements)
310
311 srclfsvfs = srcrepo.svfs.lfslocalblobstore.vfs
312 dstlfsvfs = dstrepo.svfs.lfslocalblobstore.vfs
313
314 for dirpath, dirs, files in srclfsvfs.walk():
315 for oid in files:
316 srcrepo.ui.write(_('copying lfs blob %s\n') % oid)
317 lfutil.link(srclfsvfs.join(oid), dstlfsvfs.join(oid))
318
306 def upgraderequirements(orig, repo):
319 def upgraderequirements(orig, repo):
307 reqs = orig(repo)
320 reqs = orig(repo)
308 if 'lfs' in repo.requirements:
321 if 'lfs' in repo.requirements:
@@ -548,6 +548,7 b' Check upgrading a large file repository'
548 finished migrating 2 changelog revisions; change in size: 0 bytes
548 finished migrating 2 changelog revisions; change in size: 0 bytes
549 finished migrating 6 total revisions; total change in store size: 0 bytes
549 finished migrating 6 total revisions; total change in store size: 0 bytes
550 copying phaseroots
550 copying phaseroots
551 copying lfs blob d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
551 data fully migrated to temporary repository
552 data fully migrated to temporary repository
552 marking source repository as being upgraded; clients will be unable to read from repository
553 marking source repository as being upgraded; clients will be unable to read from repository
553 starting in-place swap of repository data
554 starting in-place swap of repository data
@@ -561,11 +562,8 b' Check upgrading a large file repository'
561
562
562 $ grep lfs .hg/requires
563 $ grep lfs .hg/requires
563 lfs
564 lfs
564 TODO: restore the local lfs store. For now, objects are copied from the user
565 cache as needed.
566 $ find .hg/store/lfs -type f
565 $ find .hg/store/lfs -type f
567 find: `.hg/store/lfs': $ENOENT$
566 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
568 [1]
569 $ hg verify
567 $ hg verify
570 checking changesets
568 checking changesets
571 checking manifests
569 checking manifests
General Comments 0
You need to be logged in to leave comments. Login now