##// END OF EJS Templates
largefiles: move "copyalltostore" invocation into "markcommitted"...
FUJIWARA Katsunori -
r23276:4be75483 default
parent child Browse files
Show More
@@ -268,6 +268,7 b' def _commitcontext(rdst, parents, ctx, d'
268 268 mctx = context.memctx(rdst, parents, ctx.description(), dstfiles,
269 269 getfilectx, ctx.user(), ctx.date(), ctx.extra())
270 270 ret = rdst.commitctx(mctx)
271 lfutil.copyalltostore(rdst, ret)
271 272 rdst.setparents(ret)
272 273 revmap[ctx.node()] = rdst.changelog.tip()
273 274
@@ -204,7 +204,7 b' def copyalltostore(repo, node):'
204 204 def copytostoreabsolute(repo, file, hash):
205 205 if inusercache(repo.ui, hash):
206 206 link(usercachepath(repo.ui, hash), storepath(repo, hash))
207 elif not getattr(repo, "_isconverting", False):
207 else:
208 208 util.makedirs(os.path.dirname(storepath(repo, hash)))
209 209 dst = util.atomictempfile(storepath(repo, hash),
210 210 createmode=repo.store.createmode)
@@ -408,6 +408,9 b' def markcommitted(orig, ctx, node):'
408 408 synclfdirstate(repo, lfdirstate, lfile, False)
409 409 lfdirstate.write()
410 410
411 # As part of committing, copy all of the largefiles into the cache.
412 copyalltostore(repo, node)
413
411 414 def getlfilestoupdate(oldstandins, newstandins):
412 415 changedstandins = set(oldstandins).symmetric_difference(set(newstandins))
413 416 filelist = []
@@ -1226,14 +1226,6 b' def overridecat(orig, ui, repo, file1, *'
1226 1226 err = 0
1227 1227 return err
1228 1228
1229 def mercurialsinkbefore(orig, sink):
1230 sink.repo._isconverting = True
1231 orig(sink)
1232
1233 def mercurialsinkafter(orig, sink):
1234 sink.repo._isconverting = False
1235 orig(sink)
1236
1237 1229 def mergeupdate(orig, repo, node, branchmerge, force, partial,
1238 1230 *args, **kwargs):
1239 1231 wlock = repo.wlock()
@@ -241,11 +241,8 b' def reposetup(ui, repo):'
241 241 self.lfstatus = True
242 242 return scmutil.status(*result)
243 243
244 # As part of committing, copy all of the largefiles into the
245 # cache.
246 244 def commitctx(self, ctx, *args, **kwargs):
247 245 node = super(lfilesrepo, self).commitctx(ctx, *args, **kwargs)
248 lfutil.copyalltostore(self, node)
249 246 class lfilesctx(ctx.__class__):
250 247 def markcommitted(self, node):
251 248 orig = super(lfilesctx, self).markcommitted
@@ -174,10 +174,3 b' def uisetup(ui):'
174 174 if name == 'transplant':
175 175 extensions.wrapcommand(getattr(module, 'cmdtable'), 'transplant',
176 176 overrides.overridetransplant)
177 if name == 'convert':
178 convcmd = getattr(module, 'convcmd')
179 hgsink = getattr(convcmd, 'mercurial_sink')
180 extensions.wrapfunction(hgsink, 'before',
181 overrides.mercurialsinkbefore)
182 extensions.wrapfunction(hgsink, 'after',
183 overrides.mercurialsinkafter)
@@ -611,3 +611,16 b' the working context)'
611 611 #endif
612 612
613 613 $ cd ..
614
615 Test that "hg convert" avoids copying largefiles from the working
616 directory into store, because "hg convert" doesn't update largefiles
617 in the working directory (removing files under ".cache/largefiles"
618 forces "hg convert" to copy corresponding largefiles)
619
620 $ cat >> $HGRCPATH <<EOF
621 > [extensions]
622 > convert =
623 > EOF
624
625 $ rm $TESTTMP/.cache/largefiles/6a4f36d4075fbe0f30ec1d26ca44e63c05903671
626 $ hg convert -q repo repo.converted
General Comments 0
You need to be logged in to leave comments. Login now