diff --git a/extension-manifest.json b/extension-manifest.json index 74e8470..76382ca 100644 --- a/extension-manifest.json +++ b/extension-manifest.json @@ -2,7 +2,7 @@ "manifestVersion": 1, "id": "jessehouwing-vsts-tfvc-tasks-TEST", "name": "TFVC Build Tasks", - "version": "1.1.38", + "version": "1.1.39", "publisher": "jessehouwing", "public": false, "targets": [ diff --git a/vsts-tfvc-add/TfvcAdd.ps1 b/vsts-tfvc-add/TfvcAdd.ps1 index 489432e..246b982 100644 --- a/vsts-tfvc-add/TfvcAdd.ps1 +++ b/vsts-tfvc-add/TfvcAdd.ps1 @@ -6,7 +6,7 @@ param( [ValidateSet("None", "Full", "OneLevel")] [string] $Recursion = "None", [ValidateSet($true, $false, "")] - [string] $Recursive, + [string] $Recursive, #For backwards compatibility reasons [string] $ApplyLocalitemExclusions = $true ) diff --git a/vsts-tfvc-add/task.json b/vsts-tfvc-add/task.json index 10ffc37..1192a3e 100644 --- a/vsts-tfvc-add/task.json +++ b/vsts-tfvc-add/task.json @@ -9,7 +9,7 @@ "version": { "Major": 1, "Minor": 1, - "Patch": 38 + "Patch": 39 }, "minimumAgentVersion": "1.83.0", "groups": [ diff --git a/vsts-tfvc-checkin/TfvcCheckin.ps1 b/vsts-tfvc-checkin/TfvcCheckin.ps1 index 97eccfd..7bb8a11 100644 --- a/vsts-tfvc-checkin/TfvcCheckin.ps1 +++ b/vsts-tfvc-checkin/TfvcCheckin.ps1 @@ -12,7 +12,10 @@ param( [string] $ConfirmUnderstand = $false, [string] $OverridePolicy = $false, [string] $OverridePolicyReason = "", - [string] $Notes = "" + [string] $Notes = "", + + [string] $AutoDetectAdds = $false, + [string] $AutoDetectDeletes = $false ) Write-Verbose "Entering script $($MyInvocation.MyCommand.Name)" @@ -84,7 +87,6 @@ Function Evaluate-Checkin { } } - Function Handle-PolicyOverride { [cmdletbinding()] param( @@ -119,8 +121,7 @@ Function Handle-PolicyOverride { } } -function Parse-CheckinNotes -{ +function Parse-CheckinNotes { [cmdletbinding()] param( [string] $Notes @@ -159,17 +160,21 @@ Try $RecursionType = [Microsoft.TeamFoundation.VersionControl.Client.RecursionType]$Recursion - if ($Itemspec -ne "") + [string[]] $FilesToCheckin = $ItemSpec -split "(;|\r?\n)" + Write-Output $FilesToCheckin + + if ($AutoDetectAdds -eq $true) { - [string[]] $FilesToCheckin = $ItemSpec -split "(;|\r?\n)" - Write-Output $FilesToCheckin - $pendingChanges = $provider.Workspace.GetPendingChanges( [string[]]@($FilesToCheckin), $RecursionType ) + AutoPend-WorkspaceChanges -Provider $provider -Items @($FilesToCheckin) -RecursionType $RecursionType -ChangeType "Add" } - else + + if ($AutoDetectDeletes -eq $true) { - $pendingChanges = $provider.Workspace.GetPendingChanges($RecursionType) + AutoPend-WorkspaceChanges -Provider $provider -Items @($FilesToCheckin) -RecursionType $RecursionType -ChangeType "Delete" } - + + $pendingChanges = $provider.Workspace.GetPendingChanges( [string[]]@($FilesToCheckin), $RecursionType ) + if ($Notes -ne "") { $CheckinNotes = Parse-CheckinNotes $Notes diff --git a/vsts-tfvc-checkin/task.json b/vsts-tfvc-checkin/task.json index cf0df87..75239bc 100644 --- a/vsts-tfvc-checkin/task.json +++ b/vsts-tfvc-checkin/task.json @@ -9,7 +9,7 @@ "version": { "Major": 1, "Minor": 1, - "Patch": 38 + "Patch": 39 }, "visibility": [ "Build" @@ -29,6 +29,11 @@ "displayName": "Configuration", "isExpanded": true }, + { + "name": "autoDetectOptions", + "displayName": "Auto-detect changes", + "isExpanded": true + }, { "name": "notesOptions", "displayName": "Notes", @@ -59,6 +64,24 @@ "required": false, "type": "boolean" }, + { + "defaultValue": false, + "groupName": "autoDetectOptions", + "helpMarkdown": "Auto-detects any files added to the workspace. Always applies local workspace exclusions.", + "label": "Adds", + "name": "autoDetectAdds", + "required": false, + "type": "boolean" + }, + { + "defaultValue": false, + "groupName": "autoDetectOptions", + "helpMarkdown": "Auto-detects any files deleted from the workspace. Always applies local workspace exclusions.", + "label": "Deletes", + "name": "autoDetectDeletes", + "required": false, + "type": "boolean" + }, { "defaultValue": false, "groupName": "overrideOptions", diff --git a/vsts-tfvc-delete/task.json b/vsts-tfvc-delete/task.json index 0882320..c7e8cdd 100644 --- a/vsts-tfvc-delete/task.json +++ b/vsts-tfvc-delete/task.json @@ -9,7 +9,7 @@ "version": { "Major": 1, "Minor": 1, - "Patch": 38 + "Patch": 39 }, "minimumAgentVersion": "1.83.0", "groups": [