Summary Table
Categories |
Total Count |
PII |
0 |
URL |
0 |
DNS |
0 |
EKL |
0 |
IP |
0 |
PORT |
0 |
VsID |
0 |
CF |
0 |
AI |
0 |
VPD |
0 |
PL |
0 |
Other |
0 |
File Content
<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25">
<Routine name="GitLoader" type="MAC" languagemode="0"><![CDATA[
GitInit(pStartsWith = "")
;Import libraries inside cache/cls first, then use this function to populate the SourceControl global on initial repository load
if (pStartsWith = ""){
write "Missing Starts with Parameter" quit 1
}
set ret = 0
try { ;Find all classes that start with pStartsWith
set control = ##class(Studio.SourceControl.GIT).%New($lb("", "", "0", "2015.200000"))
set statement = ##class(%SQL.Statement).%New()
set sql = "select id from %Dictionary.ClassDefinition where id %startswith ? and generatedby is null"
do statement.%Prepare(sql)
set resultSet = statement.%Execute(pStartsWith)
while resultSet.%Next() {
set InternalName = resultSet.ID_".cls"
set InternalName = control.NormalizeInternalName(InternalName)
set extname = control.ExternalName(InternalName)
set ^SourceControl(0,InternalName)=##class(%File).GetFileDateModified(extname)
set ^SourceControl(1,InternalName)=##class(%RoutineMgr).TS(InternalName)
write !, "Added to ^SourceControl global: " _ InternalName
}
} catch ex {
set ret = 1
}
quit ret
GitLoad()
;Under Development, may be used to load the directory as well via command line (continious integration)
;Initialize the ^SourceControl global to all Cache files inside git workspace
;This is required so that you can load the working directory on a fresh install
;Otherwise you get "File not in SourceControl skipping import"
;Uses same code as dependency: Studio.SourceControl.GIT
;#define GetConfig(%name,%default) $get(^GITConfig($username,%name), %default)
;set gitpath = $$$GetConfig("gitpath", "")
;set workdir = $$$GetConfig("workdir","")
;set homedir = $$$GetConfig("homedir","")
;set authorname = $$$GetConfig("authorname","")
;set authoremail = $$$GetConfig("authoremail","")
;set output = $$$GetConfig("output","")
;set error = $$$GetConfig("error","")
;set command = ##class(Studio.SourceControl.Command.GITClient).%New(gitpath, workdir, homedir, authorname, authoremail, output, error)
;set initLoader = ##class(Studio.SourceControl.GIT).%New($lb("", "", "0", "2015.200000"))
;$$$ThrowOnError(control.Add(className))
quit 0
]]></Routine>
</Export>