Skip to content

Commit 8e76844

Browse files
committed
Production classes now excluded from export/import
1 parent afb7e34 commit 8e76844

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

cls/SourceControl/Git/Utils.cls

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,6 +1263,7 @@ ClassMethod ImportItem(InternalName As %String, force As %Boolean = 0, verbose A
12631263

12641264
set settings = ##class(SourceControl.Git.Settings).%New()
12651265
set type = ..Type(InternalName)
1266+
set imported = 1
12661267
if ..IsRoutineOutdated(InternalName) || force || (type = "ptd"){
12671268
if (type = "ptd") && ##class(%Library.EnsembleMgr).IsEnsembleNamespace() {
12681269
// Deployment manager should not reexport because studio project file includes timestamp
@@ -1277,7 +1278,8 @@ ClassMethod ImportItem(InternalName As %String, force As %Boolean = 0, verbose A
12771278
&& $$$comClassDefined("%Studio.SourceControl.Production")
12781279
&& ##class(%Studio.SourceControl.Production).IsProductionClass(
12791280
..NameWithoutExtension(InternalName), "FullExternalName") {
1280-
set sc = ##class(%Studio.SourceControl.Production).ImportProductionWithoutDefinition(filename)
1281+
write !, "Production decomposition enabled, skipping import of production class"
1282+
set imported = 0
12811283
} elseif ..UserTypeCached(InternalName,.docclass,.doctype) {
12821284
set routineMgr = ##class(%RoutineMgr).%OpenId(InternalName)
12831285
do routineMgr.Code.Rewind()
@@ -1293,12 +1295,14 @@ ClassMethod ImportItem(InternalName As %String, force As %Boolean = 0, verbose A
12931295
set sc = $system.OBJ.Load(filename,"-l-d")
12941296
}
12951297
}
1296-
if sc {
1297-
set sc = ..UpdateRoutineTSH(InternalName, fileTSH)
1298-
if type = "prj" {
1299-
set sc = $$$ADDSC(sc, ..FixProjectCspReferences(InternalName))
1298+
if $$$ISOK(sc) {
1299+
if imported {
1300+
set sc = ..UpdateRoutineTSH(InternalName, fileTSH)
1301+
if type = "prj" {
1302+
set sc = $$$ADDSC(sc, ..FixProjectCspReferences(InternalName))
1303+
}
1304+
write !, InternalName," has been imported from ", filename
13001305
}
1301-
write !, InternalName," has been imported from ", filename
13021306
} else {
13031307
write !, "ERROR importing" ,InternalName, !
13041308
do $system.Status.DisplayError(sc)
@@ -1537,7 +1541,7 @@ ClassMethod ExportItem(InternalName As %String, expand As %Boolean = 1, force As
15371541
if (type = "ptd") {
15381542
$$$QuitOnError(##class(%Studio.SourceControl.Production).ExportPTD(InternalName,"FullExternalName"))
15391543
} elseif (..ItemIsProductionToDecompose(InternalName, .productionName)) {
1540-
$$$QuitOnError(##class(%Studio.SourceControl.Production).ExportProductionWithoutDefinition(productionName,"FullExternalName"))
1544+
write !, "Production decomposition enabled, skipping export of production class"
15411545
} else {
15421546
$$$QuitOnError($system.OBJ.ExportUDL(InternalName, filename,"-d/diff"))
15431547
}
@@ -1555,7 +1559,8 @@ ClassMethod ItemIsProductionToDecompose(InternalName, Output productionName)
15551559
set settings = ##class(SourceControl.Git.Settings).%New()
15561560
set name = $piece(InternalName,".",1,*-1)
15571561
set decomposeProduction = settings.decomposeProductions && (..Type(InternalName) = "cls")
1558-
&& $$$comClassDefined(name) && $classmethod(name, "%Extends","Ens.Production")
1562+
&& $$$comClassDefined("%Studio.SourceControl.Production")
1563+
&& ##class(%Studio.SourceControl.Production).IsProductionClass(name, "FullExternalName")
15591564
if decomposeProduction {
15601565
set productionName = name
15611566
}
@@ -2633,3 +2638,4 @@ ClassMethod BaselineExport(pCommitMessage = "", pPushToRemote = "") As %Status
26332638
}
26342639

26352640
}
2641+

0 commit comments

Comments
 (0)