##// END OF EJS Templates
largefiles: omit redundant isstandin() before splitstandin()...
FUJIWARA Katsunori -
r31613:5c1d3f1b default
parent child Browse files
Show More
@@ -244,10 +244,10 b' def _lfconvert_addchangeset(rsrc, rdst, '
244 244 dstfiles.append(f)
245 245
246 246 def getfilectx(repo, memctx, f):
247 if lfutil.isstandin(f):
247 srcfname = lfutil.splitstandin(f)
248 if srcfname is not None:
248 249 # if the file isn't in the manifest then it was removed
249 250 # or renamed, return None to indicate this
250 srcfname = lfutil.splitstandin(f)
251 251 try:
252 252 fctx = ctx.filectx(srcfname)
253 253 except error.LookupError:
@@ -261,8 +261,8 b' def copyalltostore(repo, node):'
261 261
262 262 ctx = repo[node]
263 263 for filename in ctx.files():
264 if isstandin(filename) and filename in ctx.manifest():
265 realfile = splitstandin(filename)
264 realfile = splitstandin(filename)
265 if realfile is not None and filename in ctx.manifest():
266 266 copytostore(repo, ctx.node(), realfile)
267 267
268 268 def copytostoreabsolute(repo, file, hash):
@@ -478,8 +478,8 b' def markcommitted(orig, ctx, node):'
478 478
479 479 lfdirstate = openlfdirstate(repo.ui, repo)
480 480 for f in ctx.files():
481 if isstandin(f):
482 lfile = splitstandin(f)
481 lfile = splitstandin(f)
482 if lfile is not None:
483 483 synclfdirstate(repo, lfdirstate, lfile, False)
484 484 lfdirstate.write()
485 485
@@ -649,10 +649,13 b' def overridecopy(orig, ui, repo, pats, o'
649 649 m._files = [lfutil.standin(f) for f in m._files if lfile(f)]
650 650 m._fileroots = set(m._files)
651 651 origmatchfn = m.matchfn
652 m.matchfn = lambda f: (lfutil.isstandin(f) and
653 (f in manifest) and
654 origmatchfn(lfutil.splitstandin(f)) or
655 None)
652 def matchfn(f):
653 lfile = lfutil.splitstandin(f)
654 return (lfile is not None and
655 (f in manifest) and
656 origmatchfn(lfile) or
657 None)
658 m.matchfn = matchfn
656 659 return m
657 660 oldmatch = installmatchfn(overridematch)
658 661 listpats = []
@@ -767,8 +770,9 b' def overriderevert(orig, ui, repo, ctx, '
767 770 m._fileroots = set(m._files)
768 771 origmatchfn = m.matchfn
769 772 def matchfn(f):
770 if lfutil.isstandin(f):
771 return (origmatchfn(lfutil.splitstandin(f)) and
773 lfile = lfutil.splitstandin(f)
774 if lfile is not None:
775 return (origmatchfn(lfile) and
772 776 (f in ctx or f in mctx))
773 777 return origmatchfn(f)
774 778 m.matchfn = matchfn
@@ -968,18 +972,19 b' def overridearchive(orig, repo, dest, no'
968 972 for f in ctx:
969 973 ff = ctx.flags(f)
970 974 getdata = ctx[f].data
971 if lfutil.isstandin(f):
975 lfile = lfutil.splitstandin(f)
976 if lfile is not None:
972 977 if node is not None:
973 978 path = lfutil.findfile(repo, getdata().strip())
974 979
975 980 if path is None:
976 981 raise error.Abort(
977 982 _('largefile %s not found in repo store or system cache')
978 % lfutil.splitstandin(f))
983 % lfile)
979 984 else:
980 path = lfutil.splitstandin(f)
985 path = lfile
981 986
982 f = lfutil.splitstandin(f)
987 f = lfile
983 988
984 989 getdata = lambda: util.readfile(path)
985 990 write(f, 'x' in ff and 0o755 or 0o644, 'l' in ff, getdata)
@@ -1018,18 +1023,19 b' def hgsubrepoarchive(orig, repo, archive'
1018 1023 for f in ctx:
1019 1024 ff = ctx.flags(f)
1020 1025 getdata = ctx[f].data
1021 if lfutil.isstandin(f):
1026 lfile = lfutil.splitstandin(f)
1027 if lfile is not None:
1022 1028 if ctx.node() is not None:
1023 1029 path = lfutil.findfile(repo._repo, getdata().strip())
1024 1030
1025 1031 if path is None:
1026 1032 raise error.Abort(
1027 1033 _('largefile %s not found in repo store or system cache')
1028 % lfutil.splitstandin(f))
1034 % lfile)
1029 1035 else:
1030 path = lfutil.splitstandin(f)
1036 path = lfile
1031 1037
1032 f = lfutil.splitstandin(f)
1038 f = lfile
1033 1039
1034 1040 getdata = lambda: util.readfile(os.path.join(prefix, path))
1035 1041
@@ -1433,7 +1439,11 b' def mergeupdate(orig, repo, node, branch'
1433 1439 def scmutilmarktouched(orig, repo, files, *args, **kwargs):
1434 1440 result = orig(repo, files, *args, **kwargs)
1435 1441
1436 filelist = [lfutil.splitstandin(f) for f in files if lfutil.isstandin(f)]
1442 filelist = []
1443 for f in files:
1444 lf = lfutil.splitstandin(f)
1445 if lf is not None:
1446 filelist.append(lf)
1437 1447 if filelist:
1438 1448 lfcommands.updatelfiles(repo.ui, repo, filelist=filelist,
1439 1449 printmessage=False, normallookup=True)
General Comments 0
You need to be logged in to leave comments. Login now