##// END OF EJS Templates
stream: double check that self.vfs is *not* in the vfsmap...
marmoute -
r48353:65c51966 stable
parent child Browse files
Show More
@@ -560,6 +560,16 b' def _makemap(repo):'
560 def _emit2(repo, entries, totalfilesize):
560 def _emit2(repo, entries, totalfilesize):
561 """actually emit the stream bundle"""
561 """actually emit the stream bundle"""
562 vfsmap = _makemap(repo)
562 vfsmap = _makemap(repo)
563 # we keep repo.vfs out of the on purpose, ther are too many danger there
564 # (eg: .hg/hgrc),
565 #
566 # this assert is duplicated (from _makemap) as author might think this is
567 # fine, while this is really not fine.
568 if repo.vfs in vfsmap.values():
569 raise error.ProgrammingError(
570 b'repo.vfs must not be added to vfsmap for security reasons'
571 )
572
563 progress = repo.ui.makeprogress(
573 progress = repo.ui.makeprogress(
564 _(b'bundle'), total=totalfilesize, unit=_(b'bytes')
574 _(b'bundle'), total=totalfilesize, unit=_(b'bytes')
565 )
575 )
@@ -685,6 +695,15 b' def consumev2(repo, fp, filecount, files'
685 progress.update(0)
695 progress.update(0)
686
696
687 vfsmap = _makemap(repo)
697 vfsmap = _makemap(repo)
698 # we keep repo.vfs out of the on purpose, ther are too many danger
699 # there (eg: .hg/hgrc),
700 #
701 # this assert is duplicated (from _makemap) as author might think this
702 # is fine, while this is really not fine.
703 if repo.vfs in vfsmap.values():
704 raise error.ProgrammingError(
705 b'repo.vfs must not be added to vfsmap for security reasons'
706 )
688
707
689 with repo.transaction(b'clone'):
708 with repo.transaction(b'clone'):
690 ctxs = (vfs.backgroundclosing(repo.ui) for vfs in vfsmap.values())
709 ctxs = (vfs.backgroundclosing(repo.ui) for vfs in vfsmap.values())
General Comments 0
You need to be logged in to leave comments. Login now