Skip to content

Commit

Permalink
Merge pull request #1054 from jecisc/1036-Debugger-if-we-try-to-merge…
Browse files Browse the repository at this point in the history
…-without-selecting-a-branch

1036-Debugger-if-we-try-to-merge-without-selecting-a-branch
  • Loading branch information
guillep authored Nov 1, 2018
2 parents ddc6682 + eea1d75 commit 73d7e57
Show file tree
Hide file tree
Showing 19 changed files with 69 additions and 29 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
printing
printOn: aStream
super printOn: aStream.
aStream
nextPut: $[;
nextPutAll: self name;
nextPut: $]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
printing
printOn: aStream
super printOn: aStream.
aStream nextPut: $(.
self realObject printOn: aStream.
aStream nextPut: $)
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
initialization
initializeBranchesList
| dataSource |
branchesList widget
addColumn: (IceTipTableColumn newAction: #shortDescriptionWithDecoration);
dataSource: self newBranchListDataSource;
dataSource: (dataSource := self newBranchListDataSource);
bindKeyCombination: Character cr toAction: [ self accept ];
onAnnouncement: FTStrongSelectionChanged do: [ self accept ]
onAnnouncement: FTStrongSelectionChanged do: [ self accept ].

"
We would prefere to have this implementation but for now we have a bug with the caches because #branchModels return the same cache used by the datasource but not #defaultBranchSelection. If we correct that later we can clean the code bellow.
self model defaultBranchSelection ifNotNil: [ :branchModel | branchesList widget selectRowIndex: (dataSource elements indexOf: branchModel) ]."

self model branchModels detect: #isHead ifFound: [ :head | branchesList widget selectRowIndex: (dataSource elements indexOf: head) ] ifNone: [ self model hasBranches ifTrue: [ branchesList widget selectFirstVisibleRow ] ]
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
accessing
validate
self
assert: self selectedBranch isNotNil
description: 'Please select a branch to checkout.'
self selectedBranch ifNil: [ IceError signal: 'Please select a branch to checkout.' ]
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
actions
doAccept

self validate.

IceTipStandardAction new
repository: self model entity;
message: ('Verifying merge from {1}' format: { self selectedBranch name });
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
branches
^ self entity branches
12 changes: 7 additions & 5 deletions Iceberg-TipUI.package/IceTipRemoteModel.class/properties.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"classtraitcomposition" : "TWithBranchModel classTrait",
"classvars" : [ ],
"instvars" : [ ],
"name" : "IceTipRemoteModel",
"commentStamp" : "EstebanLorenzano 5/30/2018 14:33",
"super" : "IceTipEntityModel",
"category" : "Iceberg-TipUI-Model",
"traitcomposition" : "TWithBranchModel",
"type" : "normal",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "IceTipRemoteModel",
"type" : "normal"
"category" : "Iceberg-TipUI-Model"
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
branches
^ self entity localBranches
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"classtraitcomposition" : "TIceCopyCommitId classTrait",
"classtraitcomposition" : "TIceCopyCommitId classTrait + TWithBranchModel classTrait",
"classvars" : [ ],
"instvars" : [ ],
"name" : "IceTipRepositoryModel",
"commentStamp" : "EstebanLorenzano 5/30/2018 14:33",
"super" : "IceTipEntityModel",
"traitcomposition" : "TIceCopyCommitId",
"traitcomposition" : "TIceCopyCommitId + TWithBranchModel",
"type" : "normal",
"classinstvars" : [ ],
"pools" : [ ],
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
branches
branchModels
^ self branches collect: [ :each | (IceTipBranchModel repositoryModel: self repositoryModel on: each) beCached ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
branches
branches
^ self explicitRequirement
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
accessing
defaultBranchSelection
^ self branchModels
detect: #isHead
ifNone: [ self hasBranches
ifTrue: [ self branchModels ifNotEmpty: #anyOne ] ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
testing
hasBranches
^ self branches isNotEmpty
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
repositoryModel
^ self explicitRequirement
7 changes: 7 additions & 0 deletions Iceberg-TipUI.package/TWithBranchModel.trait/properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"commentStamp" : "",
"classinstvars" : [ ],
"category" : "Iceberg-TipUI-Model",
"instvars" : [ ],
"name" : "TWithBranchModel"
}
3 changes: 3 additions & 0 deletions Iceberg.package/IceRemote.class/instance/hasBranches.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
testing
hasBranches
^ self branches isNotEmpty

0 comments on commit 73d7e57

Please sign in to comment.