Files
@ 5bd42279930c
Branch filter:
Location: kallithea/rhodecode/controllers/api/api.py - annotation
5bd42279930c
970 B
text/x-python
#176 LookupError: 00changelog.i@66f0739d7517: no node
- fixed mercurial concurency bug. While there were many concurrent request to different repos at one time, sometimes there were race conditions that caused mercurial backend to mix up repository instance with current repo path from environ, a major rewrite of the middleware fixed that.
- fixed mercurial concurency bug. While there were many concurrent request to different repos at one time, sometimes there were race conditions that caused mercurial backend to mix up repository instance with current repo path from environ, a major rewrite of the middleware fixed that.
c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c c78f6bf52e9c | from rhodecode.controllers.api import JSONRPCController, JSONRPCError
from rhodecode.lib.auth import HasPermissionAllDecorator
from rhodecode.model.scm import ScmModel
class ApiController(JSONRPCController):
"""
API Controller
Each method needs to have USER as argument this is then based on given
API_KEY propagated as instance of user object
Preferably this should be first argument also
Each function should also **raise** JSONRPCError for any
errors that happens
"""
@HasPermissionAllDecorator('hg.admin')
def pull(self, user, repo):
"""
Dispatch pull action on given repo
param user:
param repo:
"""
try:
ScmModel().pull_changes(repo, self.rhodecode_user.username)
return 'Pulled from %s' % repo
except Exception:
raise JSONRPCError('Unable to pull changes from "%s"' % repo)
|