Exemple #1
0
    def test_should_return_detected_vcs_client(self, mock_detect_all_vcs_clients):
        mock_vcs_client = create_mock_vcs_client()
        mock_detect_all_vcs_clients.return_value = [mock_vcs_client]

        actual_vcs_client = detection.detect_vcs_client()

        self.assertEqual(actual_vcs_client, mock_vcs_client)
Exemple #2
0
def update(arguments):
    """
        Updates the repository in the current working directory.
    """
    if len(arguments) != 1:
        raise WrongUsageError()

    vcs_client = detect_vcs_client()
    vcs_client.update()
Exemple #3
0
def status(arguments):
    """
        Shows all changes in the current working directory.
    """
    if len(arguments) != 1:
        raise WrongUsageError()

    vcs_client = detect_vcs_client()
    vcs_client.status()
def update(arguments):
    """
        Updates the repository in the current working directory.
    """
    if len(arguments) != 1:
        raise WrongUsageError()

    vcs_client = detect_vcs_client()
    vcs_client.update()
def status(arguments):
    """
        Shows all changes in the current working directory.
    """
    if len(arguments) != 1:
        raise WrongUsageError()

    vcs_client = detect_vcs_client()
    vcs_client.status()
Exemple #6
0
def commit(arguments):
    """
        1. detect what kind of repository the current directory is.
        2. perform update using the corresponding vcs client.
        3. commit all modified files to the repository using the vcs client.
    """
    if len(arguments) == 1:
        raise WrongUsageError()

    vcs_client = detect_vcs_client()
    vcs_client.update()

    message = arguments[1]
    vcs_client.commit(message)
Exemple #7
0
def commit(arguments):
    """
        1. detect what kind of repository the current directory is.
        2. perform update using the corresponding vcs client.
        3. commit all modified files to the repository using the vcs client.
    """
    if len(arguments) == 1:
        raise WrongUsageError()

    vcs_client = detect_vcs_client()
    vcs_client.update()

    if not vcs_client.everything_was_up_to_date:
        LOGGER.error('Commit interrupted: unexpected "update" result or "update" found changes.')
        return exit(1)

    message = arguments[1]
    vcs_client.commit(message)
def commit(arguments):
    """
        1. detect what kind of repository the current directory is.
        2. perform update using the corresponding vcs client.
        3. commit all modified files to the repository using the vcs client.
    """
    if len(arguments) == 1:
        raise WrongUsageError()

    vcs_client = detect_vcs_client()
    vcs_client.update()

    if not vcs_client.everything_was_up_to_date:
        LOGGER.error(
            'Commit interrupted: unexpected "update" result or "update" found changes.'
        )
        return exit(1)

    message = arguments[1]
    vcs_client.commit(message)