コード例 #1
0
ファイル: detection_tests.py プロジェクト: amrx101/committer
    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)
コード例 #2
0
ファイル: actions.py プロジェクト: jcanfield/committer
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()
コード例 #3
0
ファイル: actions.py プロジェクト: jcanfield/committer
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()
コード例 #4
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()
コード例 #5
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()
コード例 #6
0
ファイル: actions.py プロジェクト: jcanfield/committer
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)
コード例 #7
0
ファイル: actions.py プロジェクト: amrx101/committer
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)
コード例 #8
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)