Files @ 396147bff37c
Branch filter:

Location: kallithea/kallithea/lib/vcs/backends/hg/workdir.py

Nathan
i18n: updated translation for French

Currently translated at 100.0% (1093 of 1093 strings)
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

        raw_id = self.repository.branches[branch]
        hg_merge.update(self.repository._repo, raw_id, False, False, None)