diff --git a/Iceberg-TipUI/IceTipExistingBranchPanel.class.st b/Iceberg-TipUI/IceTipExistingBranchPanel.class.st index e7254a06fa..7e807d2d27 100644 --- a/Iceberg-TipUI/IceTipExistingBranchPanel.class.st +++ b/Iceberg-TipUI/IceTipExistingBranchPanel.class.st @@ -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' } @@ -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 [ diff --git a/Iceberg-TipUI/IceTipMergeBranchDialogPresenter.class.st b/Iceberg-TipUI/IceTipMergeBranchDialogPresenter.class.st index 9a1252f105..5e1b20d1ef 100644 --- a/Iceberg-TipUI/IceTipMergeBranchDialogPresenter.class.st +++ b/Iceberg-TipUI/IceTipMergeBranchDialogPresenter.class.st @@ -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 ]