##// END OF EJS Templates
largefiles: use wrappedfunction() for util.copyfile() override...
Martin von Zweigbergk -
r41720:028bb170 default
parent child Browse files
Show More
@@ -686,10 +686,8 b' def overridecopy(orig, ui, repo, pats, o'
686 else:
686 else:
687 listpats.append(makestandin(pat))
687 listpats.append(makestandin(pat))
688
688
689 try:
690 origcopyfile = util.copyfile
691 copiedfiles = []
689 copiedfiles = []
692 def overridecopyfile(src, dest, *args, **kwargs):
690 def overridecopyfile(orig, src, dest, *args, **kwargs):
693 if (lfutil.shortname in src and
691 if (lfutil.shortname in src and
694 dest.startswith(repo.wjoin(lfutil.shortname))):
692 dest.startswith(repo.wjoin(lfutil.shortname))):
695 destlfile = dest.replace(lfutil.shortname, '')
693 destlfile = dest.replace(lfutil.shortname, '')
@@ -697,12 +695,9 b' def overridecopy(orig, ui, repo, pats, o'
697 raise IOError('',
695 raise IOError('',
698 _('destination largefile already exists'))
696 _('destination largefile already exists'))
699 copiedfiles.append((src, dest))
697 copiedfiles.append((src, dest))
700 origcopyfile(src, dest, *args, **kwargs)
698 orig(src, dest, *args, **kwargs)
701
699 with extensions.wrappedfunction(util, 'copyfile', overridecopyfile):
702 util.copyfile = overridecopyfile
703 result += orig(ui, repo, listpats, opts, rename)
700 result += orig(ui, repo, listpats, opts, rename)
704 finally:
705 util.copyfile = origcopyfile
706
701
707 lfdirstate = lfutil.openlfdirstate(ui, repo)
702 lfdirstate = lfutil.openlfdirstate(ui, repo)
708 for (src, dest) in copiedfiles:
703 for (src, dest) in copiedfiles:
General Comments 0
You need to be logged in to leave comments. Login now