##// 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 b' def overridecopy(orig, ui, repo, pats, o'
652 652 wlock = repo.wlock()
653 653
654 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 656 default='relpath', badfn=None):
657 657 if opts is None:
658 658 opts = {}
@@ -664,7 +664,7 b' def overridecopy(orig, ui, repo, pats, o'
664 664 newpats.append(pat.replace(lfutil.shortname, ''))
665 665 else:
666 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 668 m = copy.copy(match)
669 669 lfile = lambda f: lfutil.standin(f) in manifest
670 670 m._files = [lfutil.standin(f) for f in m._files if lfile(f)]
@@ -678,7 +678,6 b' def overridecopy(orig, ui, repo, pats, o'
678 678 None)
679 679 m.matchfn = matchfn
680 680 return m
681 oldmatch = installmatchfn(overridematch)
682 681 listpats = []
683 682 for pat in pats:
684 683 if matchmod.patkind(pat) is not None:
@@ -696,7 +695,8 b' def overridecopy(orig, ui, repo, pats, o'
696 695 _('destination largefile already exists'))
697 696 copiedfiles.append((src, dest))
698 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 700 result += orig(ui, repo, listpats, opts, rename)
701 701
702 702 lfdirstate = lfutil.openlfdirstate(ui, repo)
@@ -727,7 +727,6 b' def overridecopy(orig, ui, repo, pats, o'
727 727 else:
728 728 nolfiles = True
729 729 finally:
730 restorematchfn()
731 730 wlock.release()
732 731
733 732 if nolfiles and nonormalfiles:
General Comments 0
You need to be logged in to leave comments. Login now