Skip to content

Commit e938b3c

Browse files
committed
enh: improve performance of production editing by saving refresh uncommitted to the end
1 parent 13470e8 commit e938b3c

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
- Fixed business processes and rules not being added to source control automatically (#676)
1616
- Embedded Git commits settings when cloning empty repo to avert any issues
1717
- Fixed Import All options not importing the Embedded Git configuration file
18+
- Improved performance of IDE editing and baselining of decomposed productions
1819

1920
## [2.9.0] - 2025-01-09
2021

cls/SourceControl/Git/Extension.cls

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,12 +356,15 @@ Method OnAfterSave(InternalName As %String, Object As %RegisteredObject = {$$$NU
356356
$$$ThrowOnError(##class(SourceControl.Git.Utils).DeleteExternalFile(key))
357357
}
358358
} elseif '..IsInSourceControl(key) {
359-
$$$ThrowOnError(##class(SourceControl.Git.Utils).AddToSourceControl(key))
359+
$$$ThrowOnError(##class(SourceControl.Git.Utils).AddToSourceControl(key,0))
360360
} else {
361361
$$$ThrowOnError(..OnAfterSave(key))
362362
}
363363
set key = $order(productionItems(key))
364364
}
365+
if $data(productionItems) {
366+
do ##class(SourceControl.Git.Change).RefreshUncommitted(,,,1)
367+
}
365368
}
366369
if ..IsInSourceControl(InternalName) {
367370
if fromWebApp {

cls/SourceControl/Git/Util/Production.cls

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@ ClassMethod BaselineProduction(productionName, settings As SourceControl.Git.Set
1818
$$$ThrowOnError(st)
1919
set key = $order(itemInternalNames(""))
2020
while (key '= "") {
21-
set st = ##class(SourceControl.Git.Utils).AddToSourceControl(key)
21+
set st = ##class(SourceControl.Git.Utils).AddToSourceControl(key,0)
2222
$$$ThrowOnError(st)
2323
set key = $order(itemInternalNames(key))
2424
}
25+
if $data(itemInternalNames) {
26+
do ##class(SourceControl.Git.Change).RefreshUncommitted(,,,1)
27+
}
2528
} else {
2629
write !, "Exporting production in class format: " _ productionInternalName
2730
set st = ##class(SourceControl.Git.Utils).AddToSourceControl(productionInternalName)

cls/SourceControl/Git/Utils.cls

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ ClassMethod AddToServerSideSourceControl(InternalName As %String) As %Status
772772
quit ec
773773
}
774774

775-
ClassMethod AddToSourceControl(InternalName As %String) As %Status
775+
ClassMethod AddToSourceControl(InternalName As %String, refreshUncommitted As %Boolean = 1) As %Status
776776
{
777777
do ##class(SourceControl.Git.PackageManagerContext).ForInternalName(InternalName)
778778
set settings = ##class(SourceControl.Git.Settings).%New()
@@ -809,7 +809,9 @@ ClassMethod AddToSourceControl(InternalName As %String) As %Status
809809

810810
}
811811
}
812-
do ##class(SourceControl.Git.Change).RefreshUncommitted(,,,1)
812+
if refreshUncommitted {
813+
do ##class(SourceControl.Git.Change).RefreshUncommitted(,,,1)
814+
}
813815
quit ec
814816
}
815817

0 commit comments

Comments
 (0)