diff --git a/CHANGELOG.md b/CHANGELOG.md index 449e4ae6..00f810dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Baseline Export now includes decomposed production items when production decomposition is enabled (#680) - Take Ownership option in source control menu allows you to take ownership of an item edited by another user (#926) - The "warnInstanceWideUncommitted" option can now be changed through the settings page (#936) +- Added verbose option for BaselineExport ## Fixed - Fixed `` error in GetTempFileAndRoutineTS when an OS-level error code was stored as a routine timestamp (#832) diff --git a/cls/SourceControl/Git/API.cls b/cls/SourceControl/Git/API.cls index 7b86a881..46216d6d 100644 --- a/cls/SourceControl/Git/API.cls +++ b/cls/SourceControl/Git/API.cls @@ -50,7 +50,7 @@ ClassMethod Pull(pTerminateOnError As %Boolean = 0) /// Imports all items from the Git repository into IRIS. /// - pForce: if true, will import an item even if the last updated timestamp in IRIS is later than that of the file on disk. -ClassMethod ImportAll(pForce As %Boolean = 0) as %Status +ClassMethod ImportAll(pForce As %Boolean = 0) As %Status { return ##class(SourceControl.Git.Utils).ImportAll(pForce) } @@ -72,9 +72,10 @@ ClassMethod Unlock() /// Run in terminal to baseline a namespace by adding all items to source control. /// - pCommitMessage: if defined, all changes in namespace context will be committed. /// - pPushToRemote: if defined, will run a git push to the specified remote -ClassMethod BaselineExport(pCommitMessage = "", pPushToRemote = "") As %Status +/// - pVerbose: verbose output +ClassMethod BaselineExport(pCommitMessage = "", pPushToRemote = "", pVerbose = 0) As %Status { - quit ##class(SourceControl.Git.Utils).BaselineExport(pCommitMessage, pPushToRemote) + quit ##class(SourceControl.Git.Utils).BaselineExport(pCommitMessage, pPushToRemote, pVerbose) } ClassMethod MapEverywhere() As %Status diff --git a/cls/SourceControl/Git/Utils.cls b/cls/SourceControl/Git/Utils.cls index 7e015fcc..861850e5 100644 --- a/cls/SourceControl/Git/Utils.cls +++ b/cls/SourceControl/Git/Utils.cls @@ -3138,7 +3138,7 @@ ClassMethod ResetSourceControlClass() do ##class(%Studio.SourceControl.Interface).SourceControlClassSet("") } -ClassMethod BaselineExport(pCommitMessage = "", pPushToRemote = "") As %Status +ClassMethod BaselineExport(pCommitMessage = "", pPushToRemote = "", pVerbose = 0) As %Status { set sc = $$$OK try { @@ -3156,13 +3156,21 @@ ClassMethod BaselineExport(pCommitMessage = "", pPushToRemote = "") As %Status while rs.%Next(.sc) { $$$ThrowOnError(sc) set internalName = rs.Name - continue:..IsSchemaStandard(internalName) + write:pVerbose !, "baselining item: ", internalName + if ..IsSchemaStandard(internalName) { + write:pVerbose !?5, "skipping standard schema" + continue + } // exclude items in a non-default IPM package set context = ##class(SourceControl.Git.PackageManagerContext).ForInternalName(internalName) - continue:($isobject(context.Package) && 'context.IsInDefaultPackage) + if ($isobject(context.Package) && 'context.IsInDefaultPackage) { + write:pVerbose !?5, "skipping item in non-default IPM package" + continue + } $$$ThrowOnError(..AddToSourceControl(internalName)) } if settings.decomposeProductions && ##class(%Library.EnsembleMgr).IsEnsembleNamespace() { + write:pVerbose !, "baselining decomposed productions" do ##class(SourceControl.Git.Util.Production).BaselineProductions() } if pCommitMessage '= "" { @@ -3182,6 +3190,7 @@ ClassMethod BaselineExport(pCommitMessage = "", pPushToRemote = "") As %Status } } catch err { set sc = err.AsStatus() + write:pVerbose !, "Error baselining items: ", err.DisplayString() } return sc }