##// END OF EJS Templates
maintainance: added hg_rebuild_fn_cache to Mercurial lib.
marcink -
r817:09727ae6 stable
parent child Browse files
Show More
@@ -27,6 +27,7 b' from hgext.strip import strip as hgext_s'
27 from mercurial import commands
27 from mercurial import commands
28 from mercurial import unionrepo
28 from mercurial import unionrepo
29 from mercurial import verify
29 from mercurial import verify
30 from mercurial import repair
30
31
31 import vcsserver
32 import vcsserver
32 from vcsserver import exceptions
33 from vcsserver import exceptions
@@ -151,6 +152,21 b' class MercurialFactory(RepoFactory):'
151 return self._create_repo(wire, create)
152 return self._create_repo(wire, create)
152
153
153
154
155 def patch_ui_message_output(baseui):
156 baseui.setconfig('ui', 'quiet', 'false')
157 output = io.BytesIO()
158
159 def write(data, **unused_kwargs):
160 output.write(data)
161
162 baseui.status = write
163 baseui.write = write
164 baseui.warn = write
165 baseui.debug = write
166
167 return baseui, output
168
169
154 class HgRemote(RemoteBase):
170 class HgRemote(RemoteBase):
155
171
156 def __init__(self, factory):
172 def __init__(self, factory):
@@ -706,12 +722,8 b' class HgRemote(RemoteBase):'
706 def verify(self, wire,):
722 def verify(self, wire,):
707 repo = self._factory.repo(wire)
723 repo = self._factory.repo(wire)
708 baseui = self._factory._create_config(wire['config'])
724 baseui = self._factory._create_config(wire['config'])
709 baseui.setconfig('ui', 'quiet', 'false')
710 output = io.BytesIO()
711
725
712 def write(data, **unused_kwargs):
726 baseui, output = patch_ui_message_output(baseui)
713 output.write(data)
714 baseui.write = write
715
727
716 repo.ui = baseui
728 repo.ui = baseui
717 verify.verify(repo)
729 verify.verify(repo)
@@ -721,12 +733,7 b' class HgRemote(RemoteBase):'
721 def hg_update_cache(self, wire,):
733 def hg_update_cache(self, wire,):
722 repo = self._factory.repo(wire)
734 repo = self._factory.repo(wire)
723 baseui = self._factory._create_config(wire['config'])
735 baseui = self._factory._create_config(wire['config'])
724 baseui.setconfig('ui', 'quiet', 'false')
736 baseui, output = patch_ui_message_output(baseui)
725 output = io.BytesIO()
726
727 def write(data, **unused_kwargs):
728 output.write(data)
729 baseui.write = write
730
737
731 repo.ui = baseui
738 repo.ui = baseui
732 with repo.wlock(), repo.lock():
739 with repo.wlock(), repo.lock():
@@ -735,6 +742,18 b' class HgRemote(RemoteBase):'
735 return output.getvalue()
742 return output.getvalue()
736
743
737 @reraise_safe_exceptions
744 @reraise_safe_exceptions
745 def hg_rebuild_fn_cache(self, wire,):
746 repo = self._factory.repo(wire)
747 baseui = self._factory._create_config(wire['config'])
748 baseui, output = patch_ui_message_output(baseui)
749
750 repo.ui = baseui
751
752 repair.rebuildfncache(baseui, repo)
753
754 return output.getvalue()
755
756 @reraise_safe_exceptions
738 def tags(self, wire):
757 def tags(self, wire):
739 cache_on, context_uid, repo_id = self._cache_on(wire)
758 cache_on, context_uid, repo_id = self._cache_on(wire)
740 @self.region.conditional_cache_on_arguments(condition=cache_on)
759 @self.region.conditional_cache_on_arguments(condition=cache_on)
General Comments 0
You need to be logged in to leave comments. Login now