diff --git a/CHANGELOG.md b/CHANGELOG.md index bd62f6c8..7bf0d744 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - WebUI workspace view now works properly for filenames with spaces (#423) - Fixed error popups in interop editors in Studio on 2024.1 (#417) - Reintroduced amend (#425) +- Git operations that import items into IRIS now report output from compilation (#426) - Double quotes now permissible in commit messages (#433) ## [2.4.0] - 2024-07-08 diff --git a/cls/SourceControl/Git/Utils.cls b/cls/SourceControl/Git/Utils.cls index 0e0a44fc..5c08b581 100644 --- a/cls/SourceControl/Git/Utils.cls +++ b/cls/SourceControl/Git/Utils.cls @@ -1767,10 +1767,36 @@ ClassMethod RunGitCommandWithInput(command As %String, inFile As %String = "", O if syncIrisWithDiff { do ..PrintStreams(errStream, outStream) - $$$ThrowOnError(..SyncIrisWithRepoThroughDiff(.files, .filterToFiles, invert)) + set buffer = ##class(SourceControl.Git.Util.Buffer).%New() + do buffer.BeginCaptureOutput() + set st = ..SyncIrisWithRepoThroughDiff(.files, .filterToFiles, invert) + set out = ##class(%Stream.GlobalCharacter).%New() + do buffer.EndCaptureOutput(.out) + if $$$ISOK(st) { + while 'out.AtEnd { + do outStream.WriteLine(out.ReadLine()) + } + } else { + while 'out.AtEnd { + do errStream.WriteLine(out.ReadLine()) + } + } } elseif syncIrisWithCommand { do ..PrintStreams(errStream, outStream) - $$$ThrowOnError(..SyncIrisWithRepoThroughCommand(.outStream)) + set buffer = ##class(SourceControl.Git.Util.Buffer).%New() + do buffer.BeginCaptureOutput() + set st = ..SyncIrisWithRepoThroughCommand(.outStream) + set out = ##class(%Stream.Global).%New() + do buffer.EndCaptureOutput(.out) + if $$$ISOK(st) { + while 'out.AtEnd { + do outStream.WriteLine(out.ReadLine()) + } + } else { + while 'out.AtEnd { + do errStream.WriteLine(out.ReadLine()) + } + } } quit returnCode } diff --git a/cls/SourceControl/Git/WebUIDriver.cls b/cls/SourceControl/Git/WebUIDriver.cls index 419c28f8..e271c9bf 100644 --- a/cls/SourceControl/Git/WebUIDriver.cls +++ b/cls/SourceControl/Git/WebUIDriver.cls @@ -3,9 +3,6 @@ Class SourceControl.Git.WebUIDriver ClassMethod HandleRequest(pagePath As %String, InternalName As %String = "", Output handled As %Boolean = 0, Output %data As %Stream.Object) { - // Make sure we capture any stray output - set buffer = ##class(SourceControl.Git.Util.Buffer).%New() - do buffer.BeginCaptureOutput() set context = ##class(SourceControl.Git.PackageManagerContext).ForInternalName(InternalName) kill %data #dim %response as %CSP.Response @@ -165,7 +162,6 @@ ClassMethod HandleRequest(pagePath As %String, InternalName As %String = "", Out } } } - do buffer.EndCaptureOutput(.throwaway) } ClassMethod UserInfo() As %SystemBase