Skip to content

Commit

Permalink
Merge branch 'dev-2.0' into multi-working-copy
Browse files Browse the repository at this point in the history
  • Loading branch information
guillep authored Jan 19, 2024
2 parents a140995 + 7880973 commit 3078763
Show file tree
Hide file tree
Showing 19 changed files with 94 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ IceGitHubRemoveBranchesCommand class >> defaultName [
^ 'Remove Branches...'
]

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

^ IceGitHubRemoveBranchesAction new
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ IceGitHubViewPullRequestsCommand class >> defaultName [
^ 'View Pull Requests...'
]

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

^ IceGitHubViewPullRequestAction new
Expand Down
2 changes: 1 addition & 1 deletion Iceberg-TipUI/IceTipAddSshCredentialCommand.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ IceTipAddSshCredentialCommand class >> defaultName [
^ 'SSH Pair'
]

{ #category : 'execution' }
{ #category : 'executing' }
IceTipAddSshCredentialCommand >> execute [

((IceTipAddSSHCredentialsPresenter newApplication: context application)
Expand Down
18 changes: 18 additions & 0 deletions Iceberg-TipUI/IceTipEntityModel.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,24 @@ IceTipEntityModel >> isModelOf: anObject [
^ self entity = anObject
]

{ #category : 'accessing' }
IceTipEntityModel >> name [

^ self entity name
]

{ #category : 'tagging' }
IceTipEntityModel >> newCreateTagAction: aString [
<noCache>

^ IceTipStandardAction new
repository: self entity;
message: ('Creating tag {1} on commit {2}' format: { aString. self commit shortId });
onSuccessRepositoryModified;
action: [ self commit createTag: aString ]
yourself
]

{ #category : 'accessing' }
IceTipEntityModel >> repositoryModel [
^ repositoryModel
Expand Down
14 changes: 10 additions & 4 deletions Iceberg-TipUI/IceTipExistingBranchPanel.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,16 @@ IceTipExistingBranchPanel >> initializeBranchesList [

branchesList
hideColumnHeaders;
addColumn: (SpStringTableColumn evaluated: #shortDescription);
addColumn: (SpStringTableColumn evaluated: [: branch | self shortDescriptionFor: branch ]);
items: self model branchModels.

self model branchModels
detect: #isHead
ifFound: [ :head | branchesList selectItem: head ]
ifNone: [ self model hasBranches ifTrue: [ branchesList selectIndex: 1 ] ].

self flag: #pharoTodo. "Instead of detecting 'isHead', we would prefer to select 'self model defaultBranchSelection' but we have a bug with the caches. The reason is that #branchModels returns the same cache used by the list but not #defaultBranchSelection."
ifNone: [
self model hasBranches ifTrue: [ branchesList selectIndex: 1 ] ].

self flag: #pharoTodo "Instead of detecting 'isHead', we would prefer to select 'self model defaultBranchSelection' but we have a bug with the caches. The reason is that #branchModels returns the same cache used by the list but not #defaultBranchSelection."
]

{ #category : 'initialization' }
Expand All @@ -83,6 +83,12 @@ IceTipExistingBranchPanel >> selectedBranch [
^ self branchesList selection selectedItem
]

{ #category : 'initialization' }
IceTipExistingBranchPanel >> shortDescriptionFor: aBranch [
aBranch isHead ifFalse: [ ^aBranch shortDescription ].
^aBranch shortDescription , ' (current)'
]

{ #category : 'initialization' }
IceTipExistingBranchPanel >> titleForWindow [

Expand Down
6 changes: 3 additions & 3 deletions Iceberg-TipUI/IceTipInstallVersionCommand.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ IceTipInstallVersionCommand class >> defaultName [
^ 'Install this version'
]

{ #category : 'execution' }
{ #category : 'executing' }
IceTipInstallVersionCommand >> execute [
self version install

self version newInstallAction executeWithContext: self context
]

{ #category : 'activation' }
Expand Down
4 changes: 1 addition & 3 deletions Iceberg-TipUI/IceTipLoadPackageCommand.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ IceTipLoadPackageCommand >> canBeExecuted [
{ #category : 'executing' }
IceTipLoadPackageCommand >> execute [

self packageModel newLoadAction executeWithContext: self context.
Iceberg announcer announce:
(IceRepositoryModified for: self repository)
self packageModel newLoadAction executeWithContext: self context
]

{ #category : 'accessing' }
Expand Down
26 changes: 12 additions & 14 deletions Iceberg-TipUI/IceTipMergeBranchDialogPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,20 @@ IceTipMergeBranchDialogPresenter >> beSwitchAndMerge [
IceTipMergeBranchDialogPresenter >> createMergeBranchTypes [

| allTypes |
"Collect types local+remotes"
allTypes := {
(IceTipMergeBranchPanel on: self model)
titleForWindow: 'Local';
withoutHead;
icon: (self iconNamed: #branch);
yourself },
(self model remoteModels collect: [ :each |
(IceTipMergeBranchPanel on: each)
titleForWindow: each name;
icon: (self iconNamed: #remote);
yourself ]).

"Collect types local+remotes"
allTypes := { ((IceTipMergeBranchPanel on: self model)
titleForWindow: 'Local';
icon: (self iconNamed: #branch);
yourself) }
, (self model remoteModels collect: [ :each |
(IceTipMergeBranchPanel on: each)
titleForWindow: each name;
icon: (self iconNamed: #remote);
yourself ]).

"Doing this because I can trigger the accept inside the panels."
allTypes do: [ :each | each onAccept: [ self closeWindow ] ].

^ allTypes
]

Expand Down
4 changes: 2 additions & 2 deletions Iceberg-TipUI/IceTipPackageModel.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ IceTipPackageModel >> newRemoveAction [
^ IceTipStandardAction new
repository: self entity repository;
message: ('Removing package {1}' format: { self entity name });
onSuccessRepositoryModified;
action: [
onSuccessRepositoryModified;
action: [
Iceberg announcer
suspendAllForRepository: self entity repository
while: [ self entity remove ] ];
Expand Down
1 change: 0 additions & 1 deletion Iceberg-TipUI/IceTipReloadPackageCommand.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ IceTipReloadPackageCommand >> canBeExecuted [
IceTipReloadPackageCommand >> execute [

self packageModel newReloadAction executeWithContext: self context.
Iceberg announcer announce: (IceRepositoryModified for: self repository)
]

{ #category : 'accessing' }
Expand Down
4 changes: 2 additions & 2 deletions Iceberg-TipUI/IceTipRemovePackageDialogPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ Class {
IceTipRemovePackageDialogPresenter >> accept [

self removeFromRepositoryCheckbox state
ifTrue: [ self model remove ].
ifTrue: [ self model newRemoveAction executeWithContext: self ].
self unloadFromImageCheckbox state
ifTrue: [ self model unload ].
ifTrue: [ self model newUnloadAction executeWithContext: self ].
]

{ #category : 'accessing - ui' }
Expand Down
12 changes: 7 additions & 5 deletions Iceberg-TipUI/IceTipRepositoryModel.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,13 @@ IceTipRepositoryModel >> newAddRemoteActionName: aName url: anUrl [
{ #category : 'actions' }
IceTipRepositoryModel >> newCheckoutNewBranchNamed: aString inCommit: aCommit [

^ IceTipStandardAction new
repository: self entity;
message: ('Checking out new branch {1}' format: { aString });
onSuccessRepositoryModified;
action: [ self entity createBranch: aString inCommit: aCommit ]
<noCache>
^ IceTipStandardAction new
repository: self entity;
message: ('Checking out new branch {1}' format: { aString });
onSuccessRepositoryModified;
action: [ self entity createBranch: aString inCommit: aCommit ];
yourself
]

{ #category : 'tagging' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ IceTipResetBranchToThisCommitCommand >> defaultNameFromContext [

| shortId branchName |
shortId := self selectedCommitish ifNotNil: [ :commitish | commitish shortId ] ifNil: [''].
branchName := self selectedBranch ifNotNil: [:branch | branch branchName] ifNil: [ '' ].
branchName := self selectedBranch ifNotNil: [:branch | branch name ] ifNil: [ '' ].

^ 'Reset ', branchName, ' to commit ', shortId
]
Expand Down
7 changes: 0 additions & 7 deletions Iceberg-TipUI/IceTipStandardAction.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,6 @@ IceTipStandardAction >> do: aBlock [
self execute
]

{ #category : 'executing' }
IceTipStandardAction >> execute: aBlock [

self action: aBlock.
self execute
]

{ #category : 'accessing' }
IceTipStandardAction >> message [
^ message
Expand Down
14 changes: 10 additions & 4 deletions Iceberg-TipUI/IceTipTagModel.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,16 @@ IceTipTagModel >> description [
^ self entity name
]

{ #category : 'accessing' }
IceTipTagModel >> name [

^ self entity name
{ #category : 'actions' }
IceTipTagModel >> newDeleteAction [

<noCache>
^ IceTipStandardAction new
repository: self repositoryModel entity;
message: ('Removing tag {1}' format: { self name });
onSuccessRepositoryModified;
action: [ self entity delete ];
yourself
]

{ #category : 'actions' }
Expand Down
2 changes: 1 addition & 1 deletion Iceberg-TipUI/IceTipVersionHistoryModel.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ IceTipVersionHistoryModel >> retrieveHistory [
| history |

self repositoryModel checkMissing.
self application
^self application
informUser: ('Retrieving history of {1}' format: { self entity printString })
during: [ history := self repositoryModel entity log historyOfMethod: self entity ].
^ history
Expand Down
25 changes: 9 additions & 16 deletions Iceberg-TipUI/IceTipVersionModel.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,22 @@ Class {
#tag : 'Model'
}

{ #category : 'private' }
IceTipVersionModel >> basicInstall [
| definition |

definition := self entity definition.
definition realClass
compile: definition sourceCode
classified: definition category
]

{ #category : 'accessing' }
IceTipVersionModel >> commit [
^ self entity commit
]

{ #category : 'actions' }
IceTipVersionModel >> install [
IceTipVersionModel >> newInstallAction [

IceTipStandardAction new
repository: self repositoryModel entity;
message: ('Installing {1} - {2}' format: { self entity definition. self name });
onSuccessRepositoryModified;
execute: [ self basicInstall ]
^ IceTipStandardAction new
repository: self repositoryModel entity;
message: ('Installing {1} - {2}' format: {
self entity definition.
self name });
onSuccessRepositoryModified;
action: [ self entity install ];
yourself
]

{ #category : 'accessing' }
Expand Down
8 changes: 8 additions & 0 deletions Iceberg/IceLogVersion.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ IceLogVersion >> id [
^ self commit id
]

{ #category : 'actions' }
IceLogVersion >> install [

definition realClass
compile: definition sourceCode
classified: definition category
]

{ #category : 'accessing' }
IceLogVersion >> originMethod [
^ (Smalltalk at: self definition methodClass name) >> self definition selector
Expand Down
7 changes: 7 additions & 0 deletions Iceberg/IceWorkingCopyPatcherVisitor.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ IceWorkingCopyPatcherVisitor >> visitDirectoryDefinition: anIceDirectoryDefiniti
self visitChildrenOf: currentNode
]

{ #category : 'visiting' }
IceWorkingCopyPatcherVisitor >> visitExtensionDefinition: anIceExtensionDefinition [
"An extension definition represents no changes on its own, visit the individual extension-method changes."

self visitChildrenOf: currentNode
]

{ #category : 'visiting' }
IceWorkingCopyPatcherVisitor >> visitFileNode: anIceFileDefinition [

Expand Down

0 comments on commit 3078763

Please sign in to comment.