# HG changeset patch # User Martin Bornhold # Date 2016-07-08 14:02:29 # Node ID 94c8766abde4f004dc8c1629cfdb4300057d692f # Parent e1d0ae4c62ece85dcb1fc0074a20db3b2fbb45e6 pyro4: Adapt pyro4 RemoteRepo to have the same API as http RemoteRepo class. diff --git a/rhodecode/lib/vcs/client.py b/rhodecode/lib/vcs/client.py --- a/rhodecode/lib/vcs/client.py +++ b/rhodecode/lib/vcs/client.py @@ -260,7 +260,7 @@ class RemoteRepo(object): self._wire = { "path": path, "config": config, - "context": uuid.uuid4(), + "context": self._create_vcs_cache_context(), } if with_wire: self._wire.update(with_wire) @@ -287,6 +287,19 @@ class RemoteRepo(object): def __getitem__(self, key): return self.revision(key) + def _create_vcs_cache_context(self): + """ + Creates a unique string which is passed to the VCSServer on every + remote call. It is used as cache key in the VCSServer. + """ + return str(uuid.uuid4()) + + def invalidate_vcs_cache(self): + """ + This is a no-op method for the pyro4 backend but we want to have the + same API for client.RemoteRepo and client_http.RemoteRepo classes. + """ + def _get_proxy_method(proxy, name): try: