Skip to content

Commit 38afabc

Browse files
committed
added verbose output to baseline export
1 parent d5fa0d9 commit 38afabc

3 files changed

Lines changed: 17 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
- Baseline Export now includes decomposed production items when production decomposition is enabled (#680)
1212
- Take Ownership option in source control menu allows you to take ownership of an item edited by another user (#926)
1313
- The "warnInstanceWideUncommitted" option can now be changed through the settings page (#936)
14+
- Added verbose option for BaselineExport
1415

1516
## Fixed
1617
- Fixed `<VALUE OUT OF RANGE>` error in GetTempFileAndRoutineTS when an OS-level error code was stored as a routine timestamp (#832)

cls/SourceControl/Git/API.cls

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ ClassMethod Pull(pTerminateOnError As %Boolean = 0)
5050

5151
/// Imports all items from the Git repository into IRIS.
5252
/// - pForce: if true, will import an item even if the last updated timestamp in IRIS is later than that of the file on disk.
53-
ClassMethod ImportAll(pForce As %Boolean = 0) as %Status
53+
ClassMethod ImportAll(pForce As %Boolean = 0) As %Status
5454
{
5555
return ##class(SourceControl.Git.Utils).ImportAll(pForce)
5656
}
@@ -72,9 +72,10 @@ ClassMethod Unlock()
7272
/// Run in terminal to baseline a namespace by adding all items to source control.
7373
/// - pCommitMessage: if defined, all changes in namespace context will be committed.
7474
/// - pPushToRemote: if defined, will run a git push to the specified remote
75-
ClassMethod BaselineExport(pCommitMessage = "", pPushToRemote = "") As %Status
75+
/// - pVerbose: verbose output
76+
ClassMethod BaselineExport(pCommitMessage = "", pPushToRemote = "", pVerbose = 0) As %Status
7677
{
77-
quit ##class(SourceControl.Git.Utils).BaselineExport(pCommitMessage, pPushToRemote)
78+
quit ##class(SourceControl.Git.Utils).BaselineExport(pCommitMessage, pPushToRemote, pVerbose)
7879
}
7980

8081
ClassMethod MapEverywhere() As %Status

cls/SourceControl/Git/Utils.cls

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3138,7 +3138,7 @@ ClassMethod ResetSourceControlClass()
31383138
do ##class(%Studio.SourceControl.Interface).SourceControlClassSet("")
31393139
}
31403140

3141-
ClassMethod BaselineExport(pCommitMessage = "", pPushToRemote = "") As %Status
3141+
ClassMethod BaselineExport(pCommitMessage = "", pPushToRemote = "", pVerbose = 0) As %Status
31423142
{
31433143
set sc = $$$OK
31443144
try {
@@ -3156,13 +3156,21 @@ ClassMethod BaselineExport(pCommitMessage = "", pPushToRemote = "") As %Status
31563156
while rs.%Next(.sc) {
31573157
$$$ThrowOnError(sc)
31583158
set internalName = rs.Name
3159-
continue:..IsSchemaStandard(internalName)
3159+
write:pVerbose !, "baselining item: ", internalName
3160+
if ..IsSchemaStandard(internalName) {
3161+
write:pVerbose !?5, "skipping standard schema"
3162+
continue
3163+
}
31603164
// exclude items in a non-default IPM package
31613165
set context = ##class(SourceControl.Git.PackageManagerContext).ForInternalName(internalName)
3162-
continue:($isobject(context.Package) && 'context.IsInDefaultPackage)
3166+
if ($isobject(context.Package) && 'context.IsInDefaultPackage) {
3167+
write:pVerbose !?5, "skipping item in non-default IPM package"
3168+
continue
3169+
}
31633170
$$$ThrowOnError(..AddToSourceControl(internalName))
31643171
}
31653172
if settings.decomposeProductions && ##class(%Library.EnsembleMgr).IsEnsembleNamespace() {
3173+
write:pVerbose !, "baselining decomposed productions"
31663174
do ##class(SourceControl.Git.Util.Production).BaselineProductions()
31673175
}
31683176
if pCommitMessage '= "" {
@@ -3182,6 +3190,7 @@ ClassMethod BaselineExport(pCommitMessage = "", pPushToRemote = "") As %Status
31823190
}
31833191
} catch err {
31843192
set sc = err.AsStatus()
3193+
write:pVerbose !, "Error baselining items: ", err.DisplayString()
31853194
}
31863195
return sc
31873196
}

0 commit comments

Comments
 (0)