online source control
back to content
sign up free version control plan

ISAWHAppObject::UndoCheckoutProject

Description

Undoes the checkout of a project.

Syntax

long UndoCheckoutProject(
        BSTR ProjectToUndo,
        BSTR LocalFolder,
        VARIANT_BOOL Recursive,
        Enum_LocalFileHandling LocalFileHandling,
        Enum_UndoCheckOutChangedFileHandling UndoCheckoutChangedFileHandling,
        Enum_CompareFileBy CompareFileBy,
        Enum_EOL EOL,
        VARIANT_BOOL UseReadOnly,
        Enum_SetLocalFileTime SetLocalFileTime,
        VARIANT_BOOL* Cancelled,
        BSTR* ResultDescription,
        ISAWHOperationResultSet* OperationResultSet
);

Parameters

ProjectToUndo
[in] Specifies the full name of the project to be undone checkout.

LocalFolder
[in] Specifies the local directory of the project.

Recursive
[in] Specifies whether checkout of the project is to be undone recursively.

LocalFileHandling
[in] Specifies how to handle the local file after the checkout is undone.

UndoCheckoutChangedFileHandling
[in] Specifies how to handle the file if the local copy of the file has been changed.

CompareFileBy
[in] Specifies how to determine if the local copy is up-to-date, by checksum or by date/time.

EOL
[in] Specifies which end-of-line terminator is to be used for files.

UseReadOnly
[in] Specifies whether to use read-only flag on files that are not checked out.

SetLocalFileTime
[in] Specifies the type of time to be assigned to the local file.

Cancelled
[out] If the method fails, returns whether the operation is cancelled.

ResultDescription
[out] Returns the description of the return value. If the method succeeds, returns 'Completed'. If the method fails, returns the description of the error.

OperationResultSet
[out] Returns the result information set of the operation.

Return Value

If the method succeeds, returns 0. If the method fails, returns other error codes.

See Also

Sample

VB Sample:

Dim WithEvents sdkObject As SAWHSDKLib.SAWHAppObject

Set sdkObject = New SAWHSDKLib.SAWHAppObject

Private Sub UndoCheckoutProject_Click()

	Dim Cancelled As Boolean
	Dim ResultDescription As String
	Dim ProjectToUndo As String
	Dim LocalFolder As String
	Dim OperationResultSet As New SAWHOperationResultSet

	ProjectToUndo = "$/ProjectName"
	LocalFolder = "D:\ProjectToUndo"

	Dim ResultValue As Long
	ResultValue = sdkObject.UndoCheckoutProject(ProjectToUndo, LocalFolder, False, Enum_LeaveLocalFile, Enum_AskUndoCheckOutChangeFile, Enum_CompareFileByChecksum, Enum_EOLNative, False, Enum_SetLocalFileTimeCurrent, Cancelled, ResultDescription, OperationResultSet)
	If ResultValue <> 0 Then
		MsgBox "Failed to undo checkout of the project."
	End If

End Sub