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