intersystems / isc-codetidy

MIT License
2 stars 5 forks source link

Set Modified flag prior to export #43

Open isc-tleavitt opened 5 months ago

isc-tleavitt commented 5 months ago

In pkg.isc.codetidy.Utils:Run need to add:

        // Allow source control to export, etc.
        set sourceControl.Modified(pInternalName) = 1
        do sourceControl.OnAfterSave(pInternalName)
isc-tleavitt commented 5 months ago

Might also make sense to put this in Composite:

Method OnAfterSave(InternalName As %String, Object As %RegisteredObject = {$$$NULLOREF}) As %Status
{
    new $namespace
    set InternalName = ..CorrectInternalNames(InternalName)
    set tExtension = ..GetPrimaryExtension(InternalName)
    if '$isobject(tExtension) {
        quit ##super(.InternalName, .Object)
    }

    // Code required to run CodeTidy's OnAfterSave function
    set classes = ..GetSubExtensionClasses()
    set pointer = 0
    while $listnext(classes, pointer, class) {
        set extension = ..GetSubExtension(class)
        if $isobject(extension) {
            do $method(extension, "OnAfterSave", .InternalName, .Object)
            merge ..Modified = extension.Modified
        }
    }

    merge tExtension.Modified = ..Modified
    quit $method(tExtension, "OnAfterSave", .InternalName, .Object)
}