diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e7a88b..985ec17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed the back button navigation between WebUI and Settings page (#361) - Fixed issues with HL7 file extension inconsistencies (#495) - Basic mode Sync operation now imports items changed on the remote merge branch (#506) +- Deletion of a CSP file that fails because the file doesn't exist isn't treated as an error ## [2.5.0] - 2024-09-24 diff --git a/cls/SourceControl/Git/Extension.cls b/cls/SourceControl/Git/Extension.cls index 11d4954..39ae197 100644 --- a/cls/SourceControl/Git/Extension.cls +++ b/cls/SourceControl/Git/Extension.cls @@ -378,6 +378,7 @@ Method IsReadOnly(InternalName As %String) As %Boolean /// Check if another user has committed any changes to the item and return the status Method GetStatus(ByRef InternalName As %String, ByRef IsInSourceControl As %Boolean, ByRef Editable As %Boolean, ByRef IsCheckedOut As %Boolean, ByRef UserCheckedOut As %String) As %Status { + do ##class(SourceControl.Git.Utils).NormalizeInternalName(.InternalName) set context = ##class(SourceControl.Git.PackageManagerContext).ForInternalName(.InternalName) set Editable='..IsReadOnly(),IsCheckedOut=1,UserCheckedOut="" set filename=##class(SourceControl.Git.Utils).FullExternalName(.InternalName) diff --git a/cls/SourceControl/Git/PullEventHandler/IncrementalLoad.cls b/cls/SourceControl/Git/PullEventHandler/IncrementalLoad.cls index ae13af6..d36f4eb 100644 --- a/cls/SourceControl/Git/PullEventHandler/IncrementalLoad.cls +++ b/cls/SourceControl/Git/PullEventHandler/IncrementalLoad.cls @@ -67,9 +67,16 @@ Method DeleteFile(item As %String) As %Status do ##class(SourceControl.Git.Utils).RemoveRoutineTSH(item) kill $$$TrackedItems(##class(SourceControl.Git.Utils).NormalizeExtension(item)) } else { - if +$system.Status.GetErrorCodes(sc) = $$$ClassDoesNotExist { + set code = $system.Status.GetErrorCodes(sc) + if +code = $$$ClassDoesNotExist { // if something we wanted to delete is already deleted -- good! set sc = $$$OK + } elseif +code = $$$FileCanNotDelete { + // Same; couldn't delete the file presumably because it doesn't exist + set sc = $$$OK + } + if (sc = $$$OK) { + do ##class(SourceControl.Git.Utils).RemoveRoutineTSH(item) } } return sc diff --git a/cls/SourceControl/Git/Utils.cls b/cls/SourceControl/Git/Utils.cls index 2b4ed39..d4baacb 100644 --- a/cls/SourceControl/Git/Utils.cls +++ b/cls/SourceControl/Git/Utils.cls @@ -683,6 +683,7 @@ ClassMethod AddToServerSideSourceControl(InternalName As %String) As %Status ClassMethod AddToSourceControl(InternalName As %String) As %Status { + do ..NormalizeInternalName(.InternalName) do ##class(SourceControl.Git.PackageManagerContext).ForInternalName(InternalName) set settings = ##class(SourceControl.Git.Settings).%New() #dim i as %Integer @@ -2722,4 +2723,3 @@ ClassMethod BaselineExport(pCommitMessage = "", pPushToRemote = "") As %Status } } -