##// END OF EJS Templates
largefiles: use wrappedfunction() for "normal files match" in overridecopy()...
Martin von Zweigbergk -
r41722:d9fd2f74 default
parent child Browse files
Show More
@@ -78,16 +78,6 b' def composenormalfilematcher(match, mani'
78 m.matchfn = lambda f: notlfile(f) and origmatchfn(f)
78 m.matchfn = lambda f: notlfile(f) and origmatchfn(f)
79 return m
79 return m
80
80
81 def installnormalfilesmatchfn(manifest):
82 '''installmatchfn with a matchfn that ignores all largefiles'''
83 def overridematch(ctx, pats=(), opts=None, globbed=False,
84 default='relpath', badfn=None):
85 if opts is None:
86 opts = {}
87 match = oldmatch(ctx, pats, opts, globbed, default, badfn=badfn)
88 return composenormalfilematcher(match, manifest)
89 oldmatch = installmatchfn(overridematch)
90
91 def installmatchfn(f):
81 def installmatchfn(f):
92 '''monkey patch the scmutil module with a custom match function.
82 '''monkey patch the scmutil module with a custom match function.
93 Warning: it is monkey patching the _module_ on runtime! Not thread safe!'''
83 Warning: it is monkey patching the _module_ on runtime! Not thread safe!'''
@@ -616,7 +606,14 b' def overridecopy(orig, ui, repo, pats, o'
616 # match largefiles and run it again.
606 # match largefiles and run it again.
617 nonormalfiles = False
607 nonormalfiles = False
618 nolfiles = False
608 nolfiles = False
619 installnormalfilesmatchfn(repo[None].manifest())
609 manifest = repo[None].manifest()
610 def normalfilesmatchfn(orig, ctx, pats=(), opts=None, globbed=False,
611 default='relpath', badfn=None):
612 if opts is None:
613 opts = {}
614 match = orig(ctx, pats, opts, globbed, default, badfn=badfn)
615 return composenormalfilematcher(match, manifest)
616 with extensions.wrappedfunction(scmutil, 'match', normalfilesmatchfn):
620 try:
617 try:
621 result = orig(ui, repo, pats, opts, rename)
618 result = orig(ui, repo, pats, opts, rename)
622 except error.Abort as e:
619 except error.Abort as e:
@@ -625,8 +622,6 b' def overridecopy(orig, ui, repo, pats, o'
625 else:
622 else:
626 nonormalfiles = True
623 nonormalfiles = True
627 result = 0
624 result = 0
628 finally:
629 restorematchfn()
630
625
631 # The first rename can cause our current working directory to be removed.
626 # The first rename can cause our current working directory to be removed.
632 # In that case there is nothing left to copy/rename so just quit.
627 # In that case there is nothing left to copy/rename so just quit.
General Comments 0
You need to be logged in to leave comments. Login now