##// END OF EJS Templates
largefiles: use wrappedfunction() for match() override in overridecopy()...
Martin von Zweigbergk -
r41721:9f11759f default
parent child Browse files
Show More
@@ -652,7 +652,7 def overridecopy(orig, ui, repo, pats, o
652 wlock = repo.wlock()
652 wlock = repo.wlock()
653
653
654 manifest = repo[None].manifest()
654 manifest = repo[None].manifest()
655 def overridematch(ctx, pats=(), opts=None, globbed=False,
655 def overridematch(orig, ctx, pats=(), opts=None, globbed=False,
656 default='relpath', badfn=None):
656 default='relpath', badfn=None):
657 if opts is None:
657 if opts is None:
658 opts = {}
658 opts = {}
@@ -664,7 +664,7 def overridecopy(orig, ui, repo, pats, o
664 newpats.append(pat.replace(lfutil.shortname, ''))
664 newpats.append(pat.replace(lfutil.shortname, ''))
665 else:
665 else:
666 newpats.append(pat)
666 newpats.append(pat)
667 match = oldmatch(ctx, newpats, opts, globbed, default, badfn=badfn)
667 match = orig(ctx, newpats, opts, globbed, default, badfn=badfn)
668 m = copy.copy(match)
668 m = copy.copy(match)
669 lfile = lambda f: lfutil.standin(f) in manifest
669 lfile = lambda f: lfutil.standin(f) in manifest
670 m._files = [lfutil.standin(f) for f in m._files if lfile(f)]
670 m._files = [lfutil.standin(f) for f in m._files if lfile(f)]
@@ -678,7 +678,6 def overridecopy(orig, ui, repo, pats, o
678 None)
678 None)
679 m.matchfn = matchfn
679 m.matchfn = matchfn
680 return m
680 return m
681 oldmatch = installmatchfn(overridematch)
682 listpats = []
681 listpats = []
683 for pat in pats:
682 for pat in pats:
684 if matchmod.patkind(pat) is not None:
683 if matchmod.patkind(pat) is not None:
@@ -696,7 +695,8 def overridecopy(orig, ui, repo, pats, o
696 _('destination largefile already exists'))
695 _('destination largefile already exists'))
697 copiedfiles.append((src, dest))
696 copiedfiles.append((src, dest))
698 orig(src, dest, *args, **kwargs)
697 orig(src, dest, *args, **kwargs)
699 with extensions.wrappedfunction(util, 'copyfile', overridecopyfile):
698 with extensions.wrappedfunction(util, 'copyfile', overridecopyfile), \
699 extensions.wrappedfunction(scmutil, 'match', overridematch):
700 result += orig(ui, repo, listpats, opts, rename)
700 result += orig(ui, repo, listpats, opts, rename)
701
701
702 lfdirstate = lfutil.openlfdirstate(ui, repo)
702 lfdirstate = lfutil.openlfdirstate(ui, repo)
@@ -727,7 +727,6 def overridecopy(orig, ui, repo, pats, o
727 else:
727 else:
728 nolfiles = True
728 nolfiles = True
729 finally:
729 finally:
730 restorematchfn()
731 wlock.release()
730 wlock.release()
732
731
733 if nolfiles and nonormalfiles:
732 if nolfiles and nonormalfiles:
General Comments 0
You need to be logged in to leave comments. Login now