##// END OF EJS Templates
largefiles: factor out a copyalltostore() function
Dan Villiom Podlaski Christiansen -
r15796:3e5b6045 default
parent child Browse files
Show More
@@ -222,6 +222,16 b' def copytostore(repo, rev, file, uploade'
222 return
222 return
223 copytostoreabsolute(repo, repo.wjoin(file), hash)
223 copytostoreabsolute(repo, repo.wjoin(file), hash)
224
224
225 def copyalltostore(repo, node):
226 '''Copy all largefiles in a given revision to the store'''
227
228 ctx = repo[node]
229 for filename in ctx.files():
230 if isstandin(filename) and filename in ctx.manifest():
231 realfile = splitstandin(filename)
232 copytostore(repo, ctx.node(), realfile)
233
234
225 def copytostoreabsolute(repo, file, hash):
235 def copytostoreabsolute(repo, file, hash):
226 util.makedirs(os.path.dirname(storepath(repo, hash)))
236 util.makedirs(os.path.dirname(storepath(repo, hash)))
227 if inusercache(repo.ui, hash):
237 if inusercache(repo.ui, hash):
@@ -256,12 +256,7 b' def reposetup(ui, repo):'
256 # cache.
256 # cache.
257 def commitctx(self, *args, **kwargs):
257 def commitctx(self, *args, **kwargs):
258 node = super(lfiles_repo, self).commitctx(*args, **kwargs)
258 node = super(lfiles_repo, self).commitctx(*args, **kwargs)
259 ctx = self[node]
259 lfutil.copyalltostore(self, node)
260 for filename in ctx.files():
261 if lfutil.isstandin(filename) and filename in ctx.manifest():
262 realfile = lfutil.splitstandin(filename)
263 lfutil.copytostore(self, ctx.node(), realfile)
264
265 return node
260 return node
266
261
267 # Before commit, largefile standins have not had their
262 # Before commit, largefile standins have not had their
General Comments 0
You need to be logged in to leave comments. Login now