diff --git a/Iceberg-TipUI/IceTipExistingBranchPanel.class.st b/Iceberg-TipUI/IceTipExistingBranchPanel.class.st index eae8c778d0..14cb703a69 100644 --- a/Iceberg-TipUI/IceTipExistingBranchPanel.class.st +++ b/Iceberg-TipUI/IceTipExistingBranchPanel.class.st @@ -56,16 +56,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 } @@ -81,6 +81,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/IceTipMergeBranchDialog.class.st b/Iceberg-TipUI/IceTipMergeBranchDialog.class.st index 687c7de711..3aa46b995e 100644 --- a/Iceberg-TipUI/IceTipMergeBranchDialog.class.st +++ b/Iceberg-TipUI/IceTipMergeBranchDialog.class.st @@ -35,22 +35,20 @@ IceTipMergeBranchDialog >> beSwitchAndMerge [ IceTipMergeBranchDialog >> 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 ]