Skip to content

Commit 84ea497

Browse files
authored
Merge pull request #282 from intersystems/fix-default-mappings
fixed issue #250 -- Set up default mappings with SourceControl.Git.Settings
2 parents b9ac45d + 17926f8 commit 84ea497

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
- Web UI includes a "Push Branch" button for local branches that are ahead of upstream
1212

1313
### Fixed
14+
- Fixed empty mappings when SourceControl.Git.Settings is instantiated (#250)
1415
- Studio export path doesn't get weird mixed slahes on Windows (#252)
1516
- Fixed bug with adding mappings through the Settings page (#270)
1617
- Pulling add/delete of multiple non-IRIS files no longer causes error (#273)

cls/SourceControl/Git/API.cls

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ ClassMethod Configure()
1212
write !,"Configured SourceControl.Git.Extension as source control class for namespace ",$namespace
1313
set mappingsNode = ##class(SourceControl.Git.Utils).MappingsNode()
1414
if '$data(@mappingsNode) {
15-
set @mappingsNode@("CLS","*")="cls/"
16-
set @mappingsNode@("CLS","UnitTest")="test/"
17-
set @mappingsNode@("INC","*")="inc/"
18-
set @mappingsNode@("MAC","*")="rtn/"
15+
do ##class(SourceControl.Git.Utils).SetDefaultMappings(mappingsNode)
1916
write !,"Configured default mappings for classes, routines, and include files. You can customize these in the global:",!?5,mappingsNode
2017
}
2118
set gitExists = ##class(SourceControl.Git.Utils).GitBinExists(.version)

cls/SourceControl/Git/Settings.cls

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ Property Mappings [ MultiDimensional ];
3030

3131
Method %OnNew() As %Status
3232
{
33-
merge ..Mappings = @##class(SourceControl.Git.Utils).MappingsNode()
33+
set mappingsNode = ##class(SourceControl.Git.Utils).MappingsNode()
34+
if '$data(@mappingsNode) {
35+
do ##class(SourceControl.Git.Utils).SetDefaultMappings(mappingsNode)
36+
}
37+
merge ..Mappings = @mappingsNode
3438
set gitBinPath = ##class(SourceControl.Git.Utils).GitBinPath(.isDefault)
3539
if ('isDefault) {
3640
set ..gitBinPath = gitBinPath
@@ -168,3 +172,4 @@ Method OnAfterConfigure() As %Boolean
168172
}
169173

170174
}
175+

cls/SourceControl/Git/Utils.cls

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,6 @@ ClassMethod UserAction(InternalName As %String, MenuName As %String, ByRef Targe
233233
set ec = ..AddToSourceControl(InternalName)
234234
} elseif (menuItemName = "RemoveFromSC") {
235235
set ec = ..RemoveFromSourceControl(InternalName)
236-
} elseif (menuItemName = "Commit") {
237-
set Target = "Please enter a commit message"
238-
set Action = 7
239-
quit $$$OK
240236
}
241237
quit ec
242238
}
@@ -1986,5 +1982,13 @@ ClassMethod BuildCEInstallationPackage(ByRef destination As %String) As %Status
19861982
quit sc
19871983
}
19881984

1985+
ClassMethod SetDefaultMappings(mappingsNode As %String)
1986+
{
1987+
set @mappingsNode@("CLS","*")="cls/"
1988+
set @mappingsNode@("CLS","UnitTest")="test/"
1989+
set @mappingsNode@("INC","*")="inc/"
1990+
set @mappingsNode@("MAC","*")="rtn/"
1991+
}
1992+
19891993
}
19901994

0 commit comments

Comments
 (0)