##// END OF EJS Templates
First step in two-part process to rename directories to kallithea....
First step in two-part process to rename directories to kallithea. This first step is to change all references in the files where they refer to the old directory name.

File last commit:

r4186:7e5f8c12 kallithea-2.2.5-r...
r4186:7e5f8c12 kallithea-2.2.5-r...
Show More
workdir.py
22 lines | 748 B | text/x-python | PythonLexer
from kallithea.lib.vcs.backends.base import BaseWorkdir
from kallithea.lib.vcs.exceptions import BranchDoesNotExistError
from kallithea.lib.vcs.utils.hgcompat import hg_merge
class MercurialWorkdir(BaseWorkdir):
def get_branch(self):
return self.repository._repo.dirstate.branch()
def get_changeset(self):
wk_dir_id = self.repository._repo[None].parents()[0].hex()
return self.repository.get_changeset(wk_dir_id)
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
hg_merge.update(self.repository._repo, branch, False, False, None)