Skip to content

describe_merge_conflicts

describe_merge_conflicts(
    repository_name: RepositoryName,
    destination_commit_specifier: CommitName,
    source_commit_specifier: CommitName,
    merge_option: MergeOptionTypeEnum,
    file_path: Path,
    *,
    config_overrides: Optional[CodeCommitClientConfig] = None,
    max_merge_hunks: Optional[MaxResults] = None,
    conflict_detail_level: Optional[ConflictDetailLevelTypeEnum] = None,
    conflict_resolution_strategy: Optional[ConflictResolutionStrategyTypeEnum] = None,
    next_token: Optional[NextToken] = None,
) -> DescribeMergeConflictsOutput

Returns information about one or more merge conflicts in the attempted merge of two commit specifiers using the squash or three-way merge strategy. If the merge option for the attempted merge is specified as FAST_FORWARD_MERGE, an exception is thrown.

Parameters:

  • repository_name (RepositoryName) –

    The name of the repository where you want to get information about a merge conflict.

  • destination_commit_specifier (CommitName) –

    The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).

  • source_commit_specifier (CommitName) –

    The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).

  • merge_option (MergeOptionTypeEnum) –

    The merge option or strategy you want to use to merge the code.

  • max_merge_hunks (Optional[MaxResults], default: None ) –

    The maximum number of merge hunks to include in the output.

  • file_path (Path) –

    The path of the target files used to describe the conflicts.

  • conflict_detail_level (Optional[ConflictDetailLevelTypeEnum], default: None ) –

    The level of conflict detail to use. If unspecified, the default FILE_LEVEL is used, which returns a not-mergeable result if the same file has differences in both branches. If LINE_LEVEL is specified, a conflict is considered not mergeable if the same file in both branches has differences on the same line.

  • conflict_resolution_strategy (Optional[ConflictResolutionStrategyTypeEnum], default: None ) –

    Specifies which branch to use when resolving conflicts, or whether to attempt automatically merging two versions of a file. The default is NONE, which requires any conflicts to be resolved manually before the merge operation is successful.

  • next_token (Optional[NextToken], default: None ) –

    An enumeration token that, when provided in a request, returns the next batch of the results.

Raises:

Source code in docs_src/capo_codecommit/_services/code_commit.py
def describe_merge_conflicts(
    self,
    repository_name: "capo_codecommit.types.repository_name.RepositoryName",
    destination_commit_specifier: "capo_codecommit.types.commit_name.CommitName",
    source_commit_specifier: "capo_codecommit.types.commit_name.CommitName",
    merge_option: "capo_codecommit.types.merge_option_type_enum.MergeOptionTypeEnum",
    file_path: "capo_codecommit.types.path.Path",
    *,
    config_overrides: Optional[CodeCommitClientConfig] = None,
    max_merge_hunks: Optional[
        "capo_codecommit.types.max_results.MaxResults"
    ] = None,
    conflict_detail_level: Optional[
        "capo_codecommit.types.conflict_detail_level_type_enum.ConflictDetailLevelTypeEnum"
    ] = None,
    conflict_resolution_strategy: Optional[
        "capo_codecommit.types.conflict_resolution_strategy_type_enum.ConflictResolutionStrategyTypeEnum"
    ] = None,
    next_token: Optional["capo_codecommit.types.next_token.NextToken"] = None,
) -> "capo_codecommit.types.describe_merge_conflicts_output.DescribeMergeConflictsOutput":
    """<p>Returns information about one or more merge conflicts in the attempted merge of two commit specifiers using the squash or three-way merge strategy. If the merge option for the attempted merge is specified as FAST_FORWARD_MERGE, an exception is thrown.</p>

    Args:
        repository_name: <p>The name of the repository where you want to get information about a merge conflict.</p>
        destination_commit_specifier: <p>The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).</p>
        source_commit_specifier: <p>The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).</p>
        merge_option: <p>The merge option or strategy you want to use to merge the code.</p>
        max_merge_hunks: <p>The maximum number of merge hunks to include in the output.</p>
        file_path: <p>The path of the target files used to describe the conflicts. </p>
        conflict_detail_level: <p>The level of conflict detail to use. If unspecified, the default FILE_LEVEL is used, which returns a not-mergeable result if the same file has differences in both branches. If LINE_LEVEL is specified, a conflict is considered not mergeable if the same file in both branches has differences on the same line.</p>
        conflict_resolution_strategy: <p>Specifies which branch to use when resolving conflicts, or whether to attempt automatically merging two versions of a file. The default is NONE, which requires any conflicts to be resolved manually before the merge operation is successful.</p>
        next_token: <p>An enumeration token that, when provided in a request, returns the next batch of the results.</p>

    Raises:
        capo_codecommit.errors.commit_does_not_exist_exception.CommitDoesNotExistException: <p>The specified commit does not exist or no commit was specified, and the specified repository has no default branch.</p>
        capo_codecommit.errors.commit_required_exception.CommitRequiredException: <p>A commit was not specified.</p>
        capo_codecommit.errors.encryption_integrity_checks_failed_exception.EncryptionIntegrityChecksFailedException: <p>An encryption integrity check failed.</p>
        capo_codecommit.errors.encryption_key_access_denied_exception.EncryptionKeyAccessDeniedException: <p>An encryption key could not be accessed.</p>
        capo_codecommit.errors.encryption_key_disabled_exception.EncryptionKeyDisabledException: <p>The encryption key is disabled.</p>
        capo_codecommit.errors.encryption_key_not_found_exception.EncryptionKeyNotFoundException: <p>No encryption key was found.</p>
        capo_codecommit.errors.encryption_key_unavailable_exception.EncryptionKeyUnavailableException: <p>The encryption key is not available.</p>
        capo_codecommit.errors.file_does_not_exist_exception.FileDoesNotExistException: <p>The specified file does not exist. Verify that you have used the correct file name, full path, and extension.</p>
        capo_codecommit.errors.invalid_commit_exception.InvalidCommitException: <p>The specified commit is not valid.</p>
        capo_codecommit.errors.invalid_conflict_detail_level_exception.InvalidConflictDetailLevelException: <p>The specified conflict detail level is not valid.</p>
        capo_codecommit.errors.invalid_conflict_resolution_strategy_exception.InvalidConflictResolutionStrategyException: <p>The specified conflict resolution strategy is not valid.</p>
        capo_codecommit.errors.invalid_continuation_token_exception.InvalidContinuationTokenException: <p>The specified continuation token is not valid.</p>
        capo_codecommit.errors.invalid_max_merge_hunks_exception.InvalidMaxMergeHunksException: <p>The specified value for the number of merge hunks to return is not valid.</p>
        capo_codecommit.errors.invalid_merge_option_exception.InvalidMergeOptionException: <p>The specified merge option is not valid for this operation. Not all merge strategies are supported for all operations.</p>
        capo_codecommit.errors.invalid_path_exception.InvalidPathException: <p>The specified path is not valid.</p>
        capo_codecommit.errors.invalid_repository_name_exception.InvalidRepositoryNameException: <p>A specified repository name is not valid.</p> <note> <p>This exception occurs only when a specified repository name is not valid. Other exceptions occur when a required repository parameter is missing, or when a specified repository does not exist.</p> </note>
        capo_codecommit.errors.maximum_file_content_to_load_exceeded_exception.MaximumFileContentToLoadExceededException: <p>The number of files to load exceeds the allowed limit.</p>
        capo_codecommit.errors.maximum_items_to_compare_exceeded_exception.MaximumItemsToCompareExceededException: <p>The number of items to compare between the source or destination branches and the merge base has exceeded the maximum allowed.</p>
        capo_codecommit.errors.merge_option_required_exception.MergeOptionRequiredException: <p>A merge option or stategy is required, and none was provided.</p>
        capo_codecommit.errors.path_required_exception.PathRequiredException: <p>The folderPath for a location cannot be null.</p>
        capo_codecommit.errors.repository_does_not_exist_exception.RepositoryDoesNotExistException: <p>The specified repository does not exist.</p>
        capo_codecommit.errors.repository_name_required_exception.RepositoryNameRequiredException: <p>A repository name is required, but was not specified.</p>
        capo_codecommit.errors.tips_divergence_exceeded_exception.TipsDivergenceExceededException: <p>The divergence between the tips of the provided commit specifiers is too great to determine whether there might be any merge conflicts. Locally compare the specifiers using <code>git diff</code> or a diff tool.</p>
        capo_codecommit.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_codecommit.types.describe_merge_conflicts_input.DescribeMergeConflictsInput]",
    ) -> OperationResponse[
        "capo_codecommit.types.describe_merge_conflicts_output.DescribeMergeConflictsOutput"
    ]:
        import capo_codecommit._operations.code_commit_20150413.describe_merge_conflicts

        output, http_response = (
            capo_codecommit._operations.code_commit_20150413.describe_merge_conflicts.describe_merge_conflicts(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeMergeConflicts")
    )
    input_: capo_codecommit.types.describe_merge_conflicts_input.DescribeMergeConflictsInput = {
        "repository_name": repository_name,
        "destination_commit_specifier": destination_commit_specifier,
        "source_commit_specifier": source_commit_specifier,
        "merge_option": merge_option,
        "file_path": file_path,
    }
    if max_merge_hunks is not None:
        input_["max_merge_hunks"] = max_merge_hunks
    if conflict_detail_level is not None:
        input_["conflict_detail_level"] = conflict_detail_level
    if conflict_resolution_strategy is not None:
        input_["conflict_resolution_strategy"] = conflict_resolution_strategy
    if next_token is not None:
        input_["next_token"] = next_token

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output