##// END OF EJS Templates
Add mousetrap.js file from Mousetrap 1.4.5, under the Apache license....
Add mousetrap.js file from Mousetrap 1.4.5, under the Apache license. The file was download and verified via these commands: $ git clone https://github.com/ccampbell/mousetrap.git $ cd mousetrap; git checkout 1.4.5 The file in that repository named mousetrap.js is exactly the same one that appeared in RhodeCode 2.2.5 in changeset c8d3c0d61d95. The mousetrap.js states clearly that it is licensed under Apache-2.0.

File last commit:

r3796:2b5f94fc beta
r4126:158ef336 rhodecode-2.2.5-gpl
Show More
workdir.py
31 lines | 1.1 KiB | text/x-python | PythonLexer
Added VCS into rhodecode core for faster and easier deployments of new versions
r2007 import re
from rhodecode.lib.vcs.backends.base import BaseWorkdir
from rhodecode.lib.vcs.exceptions import RepositoryError
from rhodecode.lib.vcs.exceptions import BranchDoesNotExistError
class GitWorkdir(BaseWorkdir):
def get_branch(self):
headpath = self.repository._repo.refs.refpath('HEAD')
try:
content = open(headpath).read()
match = re.match(r'^ref: refs/heads/(?P<branch>.+)\n$', content)
if match:
return match.groupdict()['branch']
else:
raise RepositoryError("Couldn't compute workdir's branch")
except IOError:
# Try naive way...
raise RepositoryError("Couldn't compute workdir's branch")
def get_changeset(self):
current revision will show workdir state, not the latest revision
r3796 wk_dir_id = self.repository._repo.refs.as_dict().get('HEAD')
return self.repository.get_changeset(wk_dir_id)
Added VCS into rhodecode core for faster and easier deployments of new versions
r2007
def checkout_branch(self, branch=None):
if branch is None:
branch = self.repository.DEFAULT_BRANCH_NAME
if branch not in self.repository.branches:
raise BranchDoesNotExistError
self.repository.run_git_command(['checkout', branch])