# Path: punch/vcs_repositories/vcs_repo.py
# class VCSRepo(object):  # pragma: nocover
#     def __init__(self, working_path, config_obj, files_to_commit=None):
#     def _check_config(self):
#     def _set_command(self):
#     def _check_system(self):
#     def _run(self, command_line, error_message=None):
#     def pre_start_release(self):
#     def start_release(self):
#     def finish_release(self):
#     def post_finish_release(self):
# 
# Path: punch/vcs_repositories/exceptions.py
# class RepositoryError(Exception):
# class RepositoryWorkflowError(RepositoryError):
# class RepositorySystemError(RepositoryError):
# class RepositoryConfigurationError(RepositoryError):
# class RepositoryStatusError(RepositoryError):


import os
import re
import six
from punch.vcs_repositories import vcs_repo as vr
from punch.vcs_repositories import exceptions as e
        pass

    def finish_release(self):
        self.get_current_branch()
        try:
            if self._is_clean():
                return
            command_line = [self.command, "commit"]
            command_line.extend(["-m", self.config_obj.commit_message])
            self._run(command_line)
            tag = self._configured_tag()
            self.tag(tag)
        finally:
            self._recover_branch()

    def tag(self, tag):
        self._run([self.command, "tag", tag])

    def _recover_branch(self):
        if self._recorded_branch is not None:
            self._change_branch(self._recorded_branch)
            self._recorded_branch = None

    def _change_branch(self, branch):
        self._run([self.command, "update", branch])

    def _check_config(self):
        # Tag names cannot contain spaces
        tag = self.config_obj.options.get('tag', '')
        if ' ' in tag:

# Path: punch/vcs_repositories/vcs_repo.py
# class VCSRepo(object):  # pragma: nocover
#     def __init__(self, working_path, config_obj, files_to_commit=None):
#     def _check_config(self):
#     def _set_command(self):
#     def _check_system(self):
#     def _run(self, command_line, error_message=None):
#     def pre_start_release(self):
#     def start_release(self):
#     def finish_release(self):
#     def post_finish_release(self):
# 
# Path: punch/vcs_repositories/exceptions.py
# class RepositoryError(Exception):
# class RepositoryWorkflowError(RepositoryError):
# class RepositorySystemError(RepositoryError):
# class RepositoryConfigurationError(RepositoryError):
# class RepositoryStatusError(RepositoryError):


# Path: punch/vcs_repositories/hg_repo.py
import os
import re
import six
from punch.vcs_repositories import vcs_repo as vr
from punch.vcs_repositories import exceptions as e

        pass

    def finish_release(self):
        self.get_current_branch()
        try:
            if self._is_clean():
                return
            command_line = [self.command, "commit"]
            command_line.extend(["-m", self.config_obj.commit_message])
            self._run(command_line)
            tag = self._configured_tag()
            self.tag(tag)
        finally:
            self._recover_branch()

    def tag(self, tag):
        self._run([self.command, "tag", tag])

    def _recover_branch(self):
        if self._recorded_branch is not None:
            self._change_branch(self._recorded_branch)
            self._recorded_branch = None

    def _change_branch(self, branch):
        self._run([self.command, "update", branch])

    def _check_config(self):
        # Tag names cannot contain spaces
        tag = self.config_obj.options.get('tag', '')
        if ' ' in tag:

            raise e.RepositoryConfigurationError(