Skip to content

Commit

Permalink
Turn ref list into ref tree
Browse files Browse the repository at this point in the history
Closes #5
  • Loading branch information
MariusDoe committed Dec 16, 2024
1 parent ca2d66d commit e135ddd
Show file tree
Hide file tree
Showing 100 changed files with 413 additions and 146 deletions.
8 changes: 0 additions & 8 deletions src/GitS-Core.package/GSBrowser.class/class/gitIcon.st

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
actions
actionRefreshRefTree
self updateRefTree.
3 changes: 2 additions & 1 deletion src/GitS-Core.package/GSBrowser.class/instance/activeRef..st
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
accessing
activeRef: aString
self basicActiveRef: aString.
activeRef := aString.
self activeRefCommit ifNotNil: [:commit | self activeCommit: commit].
self
activeRefTreeMember: (aString ifNotNil: [self refTree ensure: aString]);
changed: #activeRef;
changed: #commitList.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
accessing
activeRefTreeMember: aRefTreeMember
activeRefTreeMember = aRefTreeMember ifTrue: [^ self].
activeRefTreeMember := aRefTreeMember.
self changed: #activeRefTreeMember.
(aRefTreeMember notNil and: [aRefTreeMember isRef])
ifTrue: [self activeRef: aRefTreeMember ref].
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
activeRefTreeMember
^ activeRefTreeMember

This file was deleted.

10 changes: 0 additions & 10 deletions src/GitS-Core.package/GSBrowser.class/instance/buildRefList..st

This file was deleted.

10 changes: 10 additions & 0 deletions src/GitS-Core.package/GSBrowser.class/instance/buildRefTree..st
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
toolbuilder
buildRefTree: builder
^ builder pluggableTreeSpec new
model: self;
roots: #refTreeRoots;
getSelected: #activeRefTreeMember;
setSelected: #activeRefTreeMember:;
nodeClass: GSRefTreeMemberWrapper;
menu: #refListMenu:;
yourself
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
toolbuilder
buildRefreshRefListButton: builder
buildRefreshRefTreeButton: builder
^ builder pluggableActionButtonSpec new
model: self;
action: #actionRefreshRefList;
action: #actionRefreshRefTree;
label: 'Refresh';
yourself
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
toolbuilder
buildRefsButtons: builder
^ GSGUIUtilities buildButtons: {
self buildRefreshRefListButton: builder.
self buildRefreshRefTreeButton: builder.
self buildFetchAllButton: builder.
} with: builder
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
toolbuilder
buildRefsPanel: builder
^ GSGUIUtilities buildVerticalLayout: {
self buildRefList: builder.
self buildRefTree: builder.
self buildRefsButtons: builder.
} with: builder

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ updating
everythingChanged
self
changed: #activeWorkingCopy;
changed: #refList;
changed: #commitList;
activeRef: nil;
activeCommit: (self activeWorkingCopy ifNotNil: #headCommit).
activeCommit: (self activeWorkingCopy ifNotNil: #headCommit);
initializeRefTree.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ui
initializeRefTree
self
refTree: (GSRefTree new
workingCopy: self activeWorkingCopy;
label: 'root';
ref: '';
yourself);
updateRefTree.
^ self refTree
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,6 @@ menu: aMenu forCommit: aCommit ref: refString
selector: #actionUnsetUpstreamOfBranch:
argument: refString].

isRefMenu ifTrue: [
subMenu
addLine;

add: (self showGitRefs ifTrue: ['<yes>'] ifFalse: ['<no>']), 'Show git refs'
action: #toggleShowGitRefs].

subMenu]).

^ aMenu
10 changes: 0 additions & 10 deletions src/GitS-Core.package/GSBrowser.class/instance/refList.st

This file was deleted.

3 changes: 3 additions & 0 deletions src/GitS-Core.package/GSBrowser.class/instance/refTree..st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
refTree: aRefTree
refTree := aRefTree
3 changes: 3 additions & 0 deletions src/GitS-Core.package/GSBrowser.class/instance/refTree.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
refTree
^ refTree ifNil: [self initializeRefTree]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ui
refTreeRoots
^ self refTree children
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ updating
refsChanged
self
changed: #commitList;
changed: #refList.
updateRefTree.

This file was deleted.

3 changes: 0 additions & 3 deletions src/GitS-Core.package/GSBrowser.class/instance/showGitRefs.st

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ui
updateRefTree
self activeWorkingCopy
ifNil: [self refTree children removeAll]
ifNotNil: [:workingCopy | workingCopy updateRefTree: self refTree].
self changed: #refTreeRoots.
35 changes: 17 additions & 18 deletions src/GitS-Core.package/GSBrowser.class/methodProperties.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"class" : {
"errorOutdated" : "mad 10/9/2024 17:56",
"gitIcon" : "mad 9/19/2023 15:03",
"initialize" : "mad 9/21/2023 18:47",
"open" : "mad 9/19/2023 12:44",
"registerInWorldMenu" : "mad 10/18/2023 15:14",
Expand Down Expand Up @@ -42,7 +41,7 @@
"actionPush:" : "mad 5/18/2024 11:31",
"actionPush:force:" : "mad 5/18/2024 11:31",
"actionRebaseOntoCommit:" : "mad 10/13/2024 21:41",
"actionRefreshRefList" : "mad 10/24/2023 19:54",
"actionRefreshRefTree" : "mad 12/16/2024 22:12",
"actionRemoveActiveProject" : "mad 9/21/2023 11:55",
"actionRenameActiveProject" : "mad 12/8/2023 18:46",
"actionResetToCommit:" : "mad 10/4/2024 15:04",
Expand All @@ -61,15 +60,16 @@
"activeCommit:" : "mad 5/15/2024 21:42",
"activeCommitIfNilInformAnd:" : "mad 4/5/2024 19:07",
"activeCommitInfo" : "mad 9/14/2023 19:29",
"activeRef" : "mad 9/14/2023 19:19",
"activeRef:" : "mad 5/15/2024 21:40",
"activeRef" : "mad 12/16/2024 22:15",
"activeRef:" : "mad 12/17/2024 00:18",
"activeRefCommit" : "mad 9/14/2023 19:24",
"activeRefTreeMember" : "mad 12/16/2024 23:23",
"activeRefTreeMember:" : "mad 12/17/2024 00:17",
"activeWorkingCopy" : "mad 9/19/2023 12:38",
"activeWorkingCopy:" : "mad 4/10/2024 19:17",
"activeWorkingCopyIfNilInformAnd:" : "mad 4/5/2024 19:05",
"addMappersProjectListMenu:" : "mad 10/9/2024 16:01",
"basicActiveCommit:" : "mad 5/15/2024 21:42",
"basicActiveRef:" : "mad 5/15/2024 21:40",
"basicOpen" : "mad 10/25/2024 11:36",
"buildBranchButton:" : "mad 9/14/2023 19:42",
"buildButtons:" : "mad 11/16/2024 16:23",
Expand All @@ -85,10 +85,10 @@
"buildProjectsAndRefsPanel:" : "mad 12/4/2024 18:01",
"buildPullButton:" : "mad 9/18/2023 16:19",
"buildPushButton:" : "mad 9/18/2023 14:11",
"buildRefList:" : "mad 10/9/2024 16:01",
"buildRefreshRefListButton:" : "mad 12/2/2024 01:02",
"buildRefsButtons:" : "mad 12/2/2024 00:59",
"buildRefsPanel:" : "mad 12/2/2024 00:59",
"buildRefTree:" : "mad 10/10/2024 01:20",
"buildRefreshRefTreeButton:" : "mad 12/16/2024 20:35",
"buildRefsButtons:" : "mad 12/16/2024 20:35",
"buildRefsPanel:" : "mad 12/16/2024 20:36",
"buildUpperLayout:" : "mad 10/9/2024 16:01",
"buildWindow:" : "mad 10/9/2024 16:01",
"buildWith:" : "mad 9/1/2023 14:44",
Expand All @@ -98,15 +98,14 @@
"commitListStartingCommits" : "mad 9/19/2023 12:32",
"commitReferencedBy:to:" : "mad 4/5/2024 19:45",
"currentBranchIfNilInformAnd:" : "mad 9/26/2023 16:56",
"doesRef:comeBeforeRef:" : "mad 9/19/2023 14:45",
"emptyCommit" : "mad 4/4/2024 23:07",
"ensureActiveCommitIdentityIn:" : "mad 5/15/2024 21:55",
"ensureActiveRefIdentityIn:" : "mad 5/15/2024 21:54",
"ensureHeadCommitMaterializedTo:" : "mad 10/9/2024 16:01",
"everythingChanged" : "mad 12/22/2023 17:59",
"everythingChanged" : "mad 12/16/2024 22:13",
"ifRepositoryDoesNotExist:" : "mad 11/30/2023 17:08",
"initializeRefTree" : "mad 12/16/2024 22:16",
"menu:forCommit:" : "mad 4/5/2024 20:19",
"menu:forCommit:ref:" : "mad 12/2/2024 01:01",
"menu:forCommit:ref:" : "mad 12/16/2024 20:35",
"menu:forRef:" : "mad 11/16/2024 16:14",
"mergeCommitIntoHead:" : "mad 9/21/2023 13:47",
"mergeCommitIntoHead:displayName:" : "mad 12/10/2024 12:07",
Expand All @@ -132,16 +131,16 @@
"parentForPick:" : "mad 4/5/2024 14:44",
"projectListMenu:" : "mad 11/16/2024 17:36",
"refChanged:" : "mad 5/15/2024 20:47",
"refList" : "mad 5/15/2024 21:43",
"refListMenu:" : "mad 11/16/2024 16:09",
"refTree" : "mad 12/16/2024 22:03",
"refTree:" : "mad 12/16/2024 22:03",
"refTreeRoots" : "mad 12/16/2024 21:55",
"refTypeName:" : "mad 11/29/2023 15:59",
"refsChanged" : "mad 5/15/2024 20:47",
"refsChanged" : "mad 12/16/2024 20:45",
"requestBranchNameFor:at:fromRef:" : "mad 4/5/2024 19:29",
"showGitRefs" : "mad 10/16/2023 21:39",
"showGitRefs:" : "mad 10/16/2023 21:50",
"toggleShowGitRefs" : "mad 10/16/2023 21:50",
"unitOfWork" : "mad 9/19/2023 12:37",
"update:" : "mad 5/15/2024 20:47",
"updateRefTree" : "mad 12/16/2024 22:13",
"validateDialogHasNoConflicts:before:" : "mad 9/27/2023 16:11",
"validateDialogState:andOriginalHeadCommit:before:" : "mad 9/19/2023 12:37",
"warnIfImageNotClean:" : "mad 11/7/2023 15:24",
Expand Down
3 changes: 2 additions & 1 deletion src/GitS-Core.package/GSBrowser.class/properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"activeWorkingCopy",
"activeCommit",
"activeRef",
"showGitRefs" ],
"refTree",
"activeRefTreeMember" ],
"name" : "GSBrowser",
"pools" : [
],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ref-tree
addOtherRefsRootTo: aRefTree references: aCollection
| other |
other := aRefTree ensureDirectory: '' label: 'other refs'.
((aCollection
select: [:each | each beginsWith: 'refs/squeak/'])
collect: [:each | (((each splitBy: '/') first: 3) joinSeparatedBy: '/'), $/])
asSet do: [:imageRef | | image |
image := other
ensureDirectory: imageRef
label: (imageRef = self refsBaseName ifTrue: ['this image'] ifFalse: ['a different image']).
imageRef = self refsBaseName
ifFalse: [image ensureDirectory: imageRef, 'heads/' label: 'local branches']].
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ref-tree
addRefTreeRootsTo: aRefTree references: aCollection
aRefTree ensureDirectory: self branchesBaseName label: 'local branches'.
self remoteNames do: [:each |
aRefTree
ensureDirectory: self remoteRefBaseName, each, $/
label: ('remote branches on {1}' format: {each printString})].
aRefTree
ensureDirectory: self gitBranchesBaseName label: 'external branches';
ensureDirectory: 'refs/tags/' label: 'tags'.
self addOtherRefsRootTo: aRefTree references: aCollection.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ref-tree
updateRefTree: aRefTree
| keep references |
references := self allReferences.
self addRefTreeRootsTo: aRefTree references: references.
keep := Set new.
references do: [:each | | member |
member := aRefTree ensure: each.
keep addAll: member withAllParents].
aRefTree
keepOnly: keep;
compressChildrenUnsorted.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
"withoutGitSuffix:" : "mad 11/13/2023 12:03" },
"instance" : {
"actionAddRemote" : "mad 10/9/2024 16:01",
"addOtherRefsRootTo:references:" : "mad 12/17/2024 00:09",
"addRefTreeRootsTo:references:" : "mad 12/16/2024 23:54",
"allReferences" : "mad 11/30/2023 21:44",
"basicHeadRef" : "mad 11/30/2023 13:15",
"branchName:" : "mad 6/4/2023 16:09",
Expand Down Expand Up @@ -81,7 +83,6 @@
"initialize" : "mad 10/6/2024 21:15",
"initializeHead" : "mad 11/30/2023 13:17",
"isGitBranchRef:" : "mad 5/23/2024 18:37",
"isHeadDetached" : "mad 11/30/2023 13:17",
"isImageClean" : "mad 10/9/2024 16:01",
"isReferencedByHead:" : "mad 10/16/2023 22:52",
"isRemoteRef:" : "mad 12/8/2023 19:47",
Expand Down Expand Up @@ -124,6 +125,7 @@
"updateHeadTo:message:" : "mad 4/7/2024 18:09",
"updateHeadToAndMaterialize:message:" : "mad 4/7/2024 18:10",
"updateRef:toNewCommit:" : "mad 4/29/2024 20:53",
"updateRefTree:" : "mad 12/17/2024 00:11",
"updateSymbolicHeadTo:" : "mad 4/7/2024 18:01",
"updateSymbolicHeadToCommit:" : "mad 4/7/2024 18:01",
"updateSymbolicHeadToRef:" : "mad 4/7/2024 18:00",
Expand Down
Empty file.
3 changes: 3 additions & 0 deletions src/GitS-Core.package/GSRefTree.class/instance/addRef..st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
adding
addRef: aString
^ self children add: (self createRef: aString)
Loading

0 comments on commit e135ddd

Please sign in to comment.