Skip to content

Commit

Permalink
fix: more normalization of InternalName
Browse files Browse the repository at this point in the history
Addresses some edge cases / gaps in web application-based development
  • Loading branch information
isc-tleavitt committed Oct 2, 2024
1 parent a45e563 commit d5a9bfa
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions cls/SourceControl/Git/Extension.cls
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 8 additions & 1 deletion cls/SourceControl/Git/PullEventHandler/IncrementalLoad.cls
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cls/SourceControl/Git/Utils.cls
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -2722,4 +2723,3 @@ ClassMethod BaselineExport(pCommitMessage = "", pPushToRemote = "") As %Status
}

}

0 comments on commit d5a9bfa

Please sign in to comment.