##// END OF EJS Templates
http-protocol: Add a method to invalidate the VCSServer cache....
Martin Bornhold -
r403:e1d0ae4c default
parent child Browse files
Show More
@@ -90,7 +90,7 b' class RemoteRepo(object):'
90 self._wire = {
90 self._wire = {
91 "path": path,
91 "path": path,
92 "config": config,
92 "config": config,
93 "context": str(uuid.uuid4()),
93 "context": self._create_vcs_cache_context(),
94 }
94 }
95 if with_wire:
95 if with_wire:
96 self._wire.update(with_wire)
96 self._wire.update(with_wire)
@@ -125,6 +125,21 b' class RemoteRepo(object):'
125 def __getitem__(self, key):
125 def __getitem__(self, key):
126 return self.revision(key)
126 return self.revision(key)
127
127
128 def _create_vcs_cache_context(self):
129 """
130 Creates a unique string which is passed to the VCSServer on every
131 remote call. It is used as cache key in the VCSServer.
132 """
133 return str(uuid.uuid4())
134
135 def invalidate_vcs_cache(self):
136 """
137 This invalidates the context which is sent to the VCSServer on every
138 call to a remote method. It forces the VCSServer to create a fresh
139 repository instance on the next call to a remote method.
140 """
141 self._wire['context'] = self._create_vcs_cache_context()
142
128
143
129 class RemoteObject(object):
144 class RemoteObject(object):
130
145
General Comments 0
You need to be logged in to leave comments. Login now