comparison hgext/largefiles/overrides.py @ 31735:3e37b479ce2f

largefiles: replace readstandin() by readasstandin() These code paths already (or should, for efficiency at repetition) know the target changectx and path of standin file.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Sat, 01 Apr 2017 02:32:47 +0900
parents 0eec36112e58
children a40e979b9d97
comparison
equal deleted inserted replaced
31734:44ff5e4ffc8c 31735:3e37b479ce2f
1355 data = ctx[f].data() 1355 data = ctx[f].data()
1356 if opts.get('decode'): 1356 if opts.get('decode'):
1357 data = repo.wwritedata(f, data) 1357 data = repo.wwritedata(f, data)
1358 fp.write(data) 1358 fp.write(data)
1359 else: 1359 else:
1360 hash = lfutil.readstandin(repo, lf, ctx) 1360 hash = lfutil.readasstandin(ctx[f])
1361 if not lfutil.inusercache(repo.ui, hash): 1361 if not lfutil.inusercache(repo.ui, hash):
1362 store = storefactory.openstore(repo) 1362 store = storefactory.openstore(repo)
1363 success, missing = store.get([(lf, hash)]) 1363 success, missing = store.get([(lf, hash)])
1364 if len(success) != 1: 1364 if len(success) != 1:
1365 raise error.Abort( 1365 raise error.Abort(
1407 lfhash = lfutil.hashfile(lfileabs) 1407 lfhash = lfutil.hashfile(lfileabs)
1408 standin = lfutil.standin(lfile) 1408 standin = lfutil.standin(lfile)
1409 lfutil.writestandin(repo, standin, lfhash, 1409 lfutil.writestandin(repo, standin, lfhash,
1410 lfutil.getexecutable(lfileabs)) 1410 lfutil.getexecutable(lfileabs))
1411 if (standin in pctx and 1411 if (standin in pctx and
1412 lfhash == lfutil.readstandin(repo, lfile, pctx)): 1412 lfhash == lfutil.readasstandin(pctx[standin])):
1413 oldclean.add(lfile) 1413 oldclean.add(lfile)
1414 for lfile in s.added: 1414 for lfile in s.added:
1415 fstandin = lfutil.standin(lfile) 1415 fstandin = lfutil.standin(lfile)
1416 if fstandin not in dctx: 1416 if fstandin not in dctx:
1417 # in this case, content of standin file is meaningless 1417 # in this case, content of standin file is meaningless