# HG changeset patch # User FUJIWARA Katsunori # Date 1490981567 -32400 # Node ID 3e37b479ce2f319169eecf187c676bbf1a63b06c # Parent 44ff5e4ffc8c03e397ebfb093dc01a799402a2bf largefiles: replace readstandin() by readasstandin() These code paths already (or should, for efficiency at repetition) know the target changectx and path of standin file. diff -r 44ff5e4ffc8c -r 3e37b479ce2f hgext/largefiles/lfcommands.py --- a/hgext/largefiles/lfcommands.py Sat Apr 01 02:32:31 2017 +0900 +++ b/hgext/largefiles/lfcommands.py Sat Apr 01 02:32:47 2017 +0900 @@ -474,7 +474,7 @@ shutil.copyfile(wvfs.join(rellfile), wvfs.join(rellfileorig)) wvfs.unlinkpath(relstandinorig) - expecthash = lfutil.readstandin(repo, lfile) + expecthash = lfutil.readasstandin(wctx[relstandin]) if expecthash != '': if lfile not in wctx: # not switched to normal file wvfs.unlinkpath(rellfile, ignoremissing=True) diff -r 44ff5e4ffc8c -r 3e37b479ce2f hgext/largefiles/lfutil.py --- a/hgext/largefiles/lfutil.py Sat Apr 01 02:32:31 2017 +0900 +++ b/hgext/largefiles/lfutil.py Sat Apr 01 02:32:47 2017 +0900 @@ -434,10 +434,11 @@ def getstandinsstate(repo): standins = [] matcher = getstandinmatcher(repo) + wctx = repo[None] for standin in repo.dirstate.walk(matcher, [], False, False): lfile = splitstandin(standin) try: - hash = readstandin(repo, lfile) + hash = readasstandin(wctx[standin]) except IOError: hash = None standins.append((lfile, hash)) diff -r 44ff5e4ffc8c -r 3e37b479ce2f hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py Sat Apr 01 02:32:31 2017 +0900 +++ b/hgext/largefiles/overrides.py Sat Apr 01 02:32:47 2017 +0900 @@ -1357,7 +1357,7 @@ data = repo.wwritedata(f, data) fp.write(data) else: - hash = lfutil.readstandin(repo, lf, ctx) + hash = lfutil.readasstandin(ctx[f]) if not lfutil.inusercache(repo.ui, hash): store = storefactory.openstore(repo) success, missing = store.get([(lf, hash)]) @@ -1409,7 +1409,7 @@ lfutil.writestandin(repo, standin, lfhash, lfutil.getexecutable(lfileabs)) if (standin in pctx and - lfhash == lfutil.readstandin(repo, lfile, pctx)): + lfhash == lfutil.readasstandin(pctx[standin])): oldclean.add(lfile) for lfile in s.added: fstandin = lfutil.standin(lfile)