# Path: punch/vcs_repositories/exceptions.py
# class RepositorySystemError(RepositoryError):
#     pass


import subprocess
import six
from punch.vcs_repositories.exceptions import RepositorySystemError
            if six.PY2:
                subprocess.check_output(null_commands)
            else:
                subprocess.check_call(null_commands, stdout=subprocess.DEVNULL)

        except not_found_exception:
            raise RepositorySystemError("Cannot run {}".format(self.command))
        except subprocess.CalledProcessError:
            raise RepositorySystemError(
                "Error running {}".format(self.command))

    def _run(self, command_line, error_message=None):
        p = subprocess.Popen(
            command_line,
            cwd=self.working_path,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE
        )
        stdout, stderr = p.communicate()

        if p.returncode != 0:
            if error_message is not None:
                raise RepositorySystemError(error_message.format(stderr))
            else:
                error_text = "An error occurred executing" + \
                    " '{}': {}\nProcess output was: {}"
                error_message = error_text.format(
                    " ".join(command_line),
                    stderr.decode('utf8'), stdout.decode('utf8')
                )

# Path: punch/vcs_repositories/exceptions.py
# class RepositorySystemError(RepositoryError):
#     pass


# Path: punch/vcs_repositories/vcs_repo.py
import subprocess
import six
from punch.vcs_repositories.exceptions import RepositorySystemError

            if six.PY2:
                subprocess.check_output(null_commands)
            else:
                subprocess.check_call(null_commands, stdout=subprocess.DEVNULL)

        except not_found_exception:
            raise RepositorySystemError("Cannot run {}".format(self.command))
        except subprocess.CalledProcessError:
            raise RepositorySystemError(
                "Error running {}".format(self.command))

    def _run(self, command_line, error_message=None):
        p = subprocess.Popen(
            command_line,
            cwd=self.working_path,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE
        )
        stdout, stderr = p.communicate()

        if p.returncode != 0:
            if error_message is not None:
                raise RepositorySystemError(error_message.format(stderr))
            else:
                error_text = "An error occurred executing" + \
                    " '{}': {}\nProcess output was: {}"
                error_message = error_text.format(
                    " ".join(command_line),
                    stderr.decode('utf8'), stdout.decode('utf8')
                )

                raise RepositorySystemError(error_message)