Skip to content

Commit 5dfa084

Browse files
committed
Treat "Other" types properly
1 parent f5eecdc commit 5dfa084

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
### Fixed
1414
- "Import All" will properly recognize new files
1515
- "Import All" and "Export All" apply only to the current package manager context and disregard items outside that context
16+
- "Import All" treats "Other" document types (DFI, LUT, etc.) properly
1617

1718
### Changed
1819
- Various minor things under the hood to support use without the package manager and/or on older platforms

cls/SourceControl/Git/Utils.cls

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,8 +1094,17 @@ ClassMethod ListItemsInFiles(ByRef itemList, ByRef err) As %Status
10941094
set mappedFilePath = ##class(%File).NormalizeFilename(mappedRelativePath, ..TempFolder())
10951095

10961096
if (##class(%File).DirectoryExists(mappedFilePath)){
1097-
set res = $system.OBJ.ImportDir(mappedFilePath,,"-d",.err,1, .tempItemList, $$$DoNotLoad)
1098-
merge itemList = tempItemList
1097+
if ##class(%Library.RoutineMgr).UserType("foo."_mappingFileType) {
1098+
set fileSpec = "*."_$zcvt(mappingFileType,"L")_";*."_$zconvert(mappingFileType,"U")
1099+
set files = ##class(%Library.File).FileSetFunc(mappedFilePath,fileSpec)
1100+
while files.%Next() {
1101+
// Assumes flat file structure
1102+
set itemList(files.ItemName) = ""
1103+
}
1104+
} else {
1105+
set res = $system.OBJ.ImportDir(mappedFilePath,,"-d",.err,1, .tempItemList, $$$DoNotLoad)
1106+
merge itemList = tempItemList
1107+
}
10991108
}
11001109

11011110
set mappingCoverage = $order($$$SourceMapping(mappingFileType, mappingCoverage))
@@ -1148,7 +1157,11 @@ ClassMethod ImportRoutines(force As %Boolean = 0) As %Status
11481157
quit:internalName=""
11491158
set context = ##class(SourceControl.Git.PackageManagerContext).ForInternalName(internalName)
11501159
continue:context.Package'=refPackage
1151-
#dim sc as %Status = ..ImportItem(internalName, force)
1160+
if ..IsInSourceControl(internalName) {
1161+
set sc = ..ImportItem(internalName, force)
1162+
} else {
1163+
set sc = ..AddToServerSideSourceControl(internalName)
1164+
}
11521165
if $$$ISERR(sc) {
11531166
set ec = $$$ADDSC(ec, sc)
11541167
}
@@ -1173,13 +1186,15 @@ ClassMethod ImportRoutines(force As %Boolean = 0) As %Status
11731186
set ec = $$$ADDSC(ec, $system.OBJ.DeleteProject(name))
11741187
}elseif type = "cls" {
11751188
set ec = $$$ADDSC(ec, $system.OBJ.Delete(item))
1176-
}elseif $listfind($listbuild("mac","int","inc","bas","mvb","mvi","dfi"), type) > 0 {
1189+
}elseif $listfind($listbuild("mac","int","inc","bas","mvb","mvi"), type) > 0 {
11771190
set ec = $$$ADDSC(ec, ##class(%Routine).Delete(item))
11781191
}elseif type = "csp" {
11791192
#dim filename = $system.CSP.GetFileName(item)
11801193
if ##class(%File).Exists(filename) && '##class(%File).Delete(filename) {
11811194
set ec = $$$ADDSC(ec, ..MakeError("Error while removing "_item))
11821195
}
1196+
}elseif ##class(%Library.RoutineMgr).UserType(item) {
1197+
set ec = $$$ADDSC(ec, ##class(%Library.RoutineMgr).Delete(item))
11831198
} else {
11841199
set deleted = 0
11851200
}
@@ -1828,4 +1843,3 @@ ClassMethod BuildCEInstallationPackage(ByRef destination As %String) As %Status
18281843
}
18291844

18301845
}
1831-

0 commit comments

Comments
 (0)