Skip to content

Commit

Permalink
Merge pull request #1846 from Rinzwind/method-history-browse-commit
Browse files Browse the repository at this point in the history
we merge and fix the code quality test later
  • Loading branch information
MarcusDenker authored Oct 25, 2024
2 parents 4e71a37 + db182fd commit 9317b08
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 1 deletion.
28 changes: 28 additions & 0 deletions Iceberg-TipUI/IceTipBrowseCommitCommand.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"
Command that opens a Repository Browser on the selected commit.
"
Class {
#name : 'IceTipBrowseCommitCommand',
#superclass : 'IceTipCommand',
#category : 'Iceberg-TipUI-Commands',
#package : 'Iceberg-TipUI',
#tag : 'Commands'
}

{ #category : 'default' }
IceTipBrowseCommitCommand class >> defaultName [

^ 'Browse commit'
]

{ #category : 'execution' }
IceTipBrowseCommitCommand >> commit [

^ self item commit
]

{ #category : 'executing' }
IceTipBrowseCommitCommand >> execute [

IceTipRepositoryBrowser openOnCommit: self commit
]
7 changes: 7 additions & 0 deletions Iceberg-TipUI/IceTipHistoryBrowser.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,13 @@ IceTipHistoryBrowser >> refreshTags [
commitList refresh
]

{ #category : 'selection' }
IceTipHistoryBrowser >> selectCommit: commit scrollToSelection: shouldScrollToSelection [

self commitList selectIndex: (self commitList items detectIndex: [ :item | item commit = commit ])
scrollToSelection: shouldScrollToSelection
]

{ #category : 'accessing' }
IceTipHistoryBrowser >> selectedCommit [

Expand Down
15 changes: 15 additions & 0 deletions Iceberg-TipUI/IceTipRepositoryBrowser.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@ IceTipRepositoryBrowser class >> onRepositoryNamed: aString [
^ self onRepository: (IceRepository registry detect: [ :each | each name = aString ])
]

{ #category : 'opening' }
IceTipRepositoryBrowser class >> openOnCommit: commit [

^ (self onRepository: commit repository)
open;
selectCommit: commit scrollToSelection: true;
yourself
]

{ #category : 'event handling' }
IceTipRepositoryBrowser >> commitishSelected: ann [

Expand Down Expand Up @@ -155,6 +164,12 @@ IceTipRepositoryBrowser >> refreshWhenRepository: ann [
self updatePresenter
]

{ #category : 'selection' }
IceTipRepositoryBrowser >> selectCommit: commit scrollToSelection: shouldScrollToSelection [

self historyPanel selectCommit: commit scrollToSelection: shouldScrollToSelection
]

{ #category : 'initialization' }
IceTipRepositoryBrowser >> selectCurrentBranch [

Expand Down
2 changes: 1 addition & 1 deletion Iceberg-TipUI/IceTipVersionHistoryBrowser.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ IceTipVersionHistoryBrowser class >> buildGeneralCommandGroupWith: presenter for
{ #category : 'commands' }
IceTipVersionHistoryBrowser class >> buildSelectionCommandGroupWith: presenter for: aCommandGroup [

{ IceTipInstallVersionCommand }
{ IceTipInstallVersionCommand. IceTipBrowseCommitCommand }
do: [ :each |
aCommandGroup register: (each forSpecContext: presenter) ]

Expand Down

0 comments on commit 9317b08

Please sign in to comment.