##// 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 mctx = context.memctx(rdst, parents, ctx.description(), dstfiles,
268 mctx = context.memctx(rdst, parents, ctx.description(), dstfiles,
269 getfilectx, ctx.user(), ctx.date(), ctx.extra())
269 getfilectx, ctx.user(), ctx.date(), ctx.extra())
270 ret = rdst.commitctx(mctx)
270 ret = rdst.commitctx(mctx)
271 lfutil.copyalltostore(rdst, ret)
271 rdst.setparents(ret)
272 rdst.setparents(ret)
272 revmap[ctx.node()] = rdst.changelog.tip()
273 revmap[ctx.node()] = rdst.changelog.tip()
273
274
@@ -204,7 +204,7 b' def copyalltostore(repo, node):'
204 def copytostoreabsolute(repo, file, hash):
204 def copytostoreabsolute(repo, file, hash):
205 if inusercache(repo.ui, hash):
205 if inusercache(repo.ui, hash):
206 link(usercachepath(repo.ui, hash), storepath(repo, hash))
206 link(usercachepath(repo.ui, hash), storepath(repo, hash))
207 elif not getattr(repo, "_isconverting", False):
207 else:
208 util.makedirs(os.path.dirname(storepath(repo, hash)))
208 util.makedirs(os.path.dirname(storepath(repo, hash)))
209 dst = util.atomictempfile(storepath(repo, hash),
209 dst = util.atomictempfile(storepath(repo, hash),
210 createmode=repo.store.createmode)
210 createmode=repo.store.createmode)
@@ -408,6 +408,9 b' def markcommitted(orig, ctx, node):'
408 synclfdirstate(repo, lfdirstate, lfile, False)
408 synclfdirstate(repo, lfdirstate, lfile, False)
409 lfdirstate.write()
409 lfdirstate.write()
410
410
411 # As part of committing, copy all of the largefiles into the cache.
412 copyalltostore(repo, node)
413
411 def getlfilestoupdate(oldstandins, newstandins):
414 def getlfilestoupdate(oldstandins, newstandins):
412 changedstandins = set(oldstandins).symmetric_difference(set(newstandins))
415 changedstandins = set(oldstandins).symmetric_difference(set(newstandins))
413 filelist = []
416 filelist = []
@@ -1226,14 +1226,6 b' def overridecat(orig, ui, repo, file1, *'
1226 err = 0
1226 err = 0
1227 return err
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 def mergeupdate(orig, repo, node, branchmerge, force, partial,
1229 def mergeupdate(orig, repo, node, branchmerge, force, partial,
1238 *args, **kwargs):
1230 *args, **kwargs):
1239 wlock = repo.wlock()
1231 wlock = repo.wlock()
@@ -241,11 +241,8 b' def reposetup(ui, repo):'
241 self.lfstatus = True
241 self.lfstatus = True
242 return scmutil.status(*result)
242 return scmutil.status(*result)
243
243
244 # As part of committing, copy all of the largefiles into the
245 # cache.
246 def commitctx(self, ctx, *args, **kwargs):
244 def commitctx(self, ctx, *args, **kwargs):
247 node = super(lfilesrepo, self).commitctx(ctx, *args, **kwargs)
245 node = super(lfilesrepo, self).commitctx(ctx, *args, **kwargs)
248 lfutil.copyalltostore(self, node)
249 class lfilesctx(ctx.__class__):
246 class lfilesctx(ctx.__class__):
250 def markcommitted(self, node):
247 def markcommitted(self, node):
251 orig = super(lfilesctx, self).markcommitted
248 orig = super(lfilesctx, self).markcommitted
@@ -174,10 +174,3 b' def uisetup(ui):'
174 if name == 'transplant':
174 if name == 'transplant':
175 extensions.wrapcommand(getattr(module, 'cmdtable'), 'transplant',
175 extensions.wrapcommand(getattr(module, 'cmdtable'), 'transplant',
176 overrides.overridetransplant)
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 #endif
611 #endif
612
612
613 $ cd ..
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