Skip to content

Commit

Permalink
Merge pull request #410 from pharo-vcs/dev-0.5
Browse files Browse the repository at this point in the history
- group branches by remote
- add filter to package tab
- move iceberg to most used tools
- minor fixes
  • Loading branch information
estebanlm authored Jul 17, 2017
2 parents 549c038 + f96928e commit 4c51bd3
Show file tree
Hide file tree
Showing 59 changed files with 262 additions and 96 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

13 changes: 13 additions & 0 deletions Iceberg-UI.package/IceAbstractBranchModel.class/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Description
--------------------

I am an abstract class to define a common API for my subclasses that will manage some actions for some branch view of Iceberg. My subclasses will encapsulate a branch or a remote.

I am use in the branch view of the main browser of Iceberg.

Public API and Key Messages
--------------------

- #children It should return the children of my element. It will probably return the branches of a remote for the remotes and nothing for the branches.
- #nameToDisplay String to show to the user.
- #status Status to show to the user about incomming/unpublished commits.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
accessing
children
"It should return the children of my element. It will probably return the branches of a remote for the remotes and nothing for the branches."

^ self subclassResponsibility
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
testing
isBranchModel
^ false
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
nameToDisplay
^ self subclassResponsibility
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
repository
^ self subclassResponsibility
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
status
^ self subclassResponsibility
11 changes: 11 additions & 0 deletions Iceberg-UI.package/IceAbstractBranchModel.class/properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "CyrilFerlicot 7/9/2017 03:25",
"super" : "Object",
"category" : "Iceberg-UI-Utils",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "IceAbstractBranchModel",
"type" : "normal"
}
24 changes: 24 additions & 0 deletions Iceberg-UI.package/IceBranchGroupModel.class/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Description
--------------------

I represent a group of branches. I am used in two principal cases.

1) We want to group the branches of a remote
2) We want to group the local branches

Examples
--------------------

"For a remote"
IceBranchGroupModel repository: anIceRepository remote: anIceRemote.

"For local branches"
IceBranchGroupModel localFromRepository: anIceRepository

Internal Representation and Key Implementation Points.
--------------------

Instance Variables
branches: <aBlockOrSymbol> This block takes the repository as parameter and should return the branches of the group
groupName: <aString> Name of the group. In case I represent a remote it will be the remote name, else it will probably be "Local"
repository: <anIceRepository> The repository where to get the branches
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
instance creation
localFromRepository: aRepository
^ self
repository: aRepository
branches: #localBranches
groupName:
('Local' asText
allBold;
yourself)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
instance creation
repository: aRepository branches: aCollection groupName: aString
^ self new
repository: aRepository;
branches: aCollection;
groupName: aString;
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
instance creation
repository: aRepository remote: aRemote
^ self repository: aRepository branches: [ :repository | aRemote branchesFrom: repository ] groupName: aRemote asString
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
branches: aBlockOrSymbol
branches := aBlockOrSymbol
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
branches
^ branches cull: self repository
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
children
^ self branches collect: [ :branch | IceBranchModel parent: self branch: branch ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
groupName: aString
groupName := aString
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
groupName
^ groupName
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
nameToDisplay
^ self groupName
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
repository: anIceRepository
repository := anIceRepository
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
repository
^ repository
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
status
^ self branches size asString , ' branches'
15 changes: 15 additions & 0 deletions Iceberg-UI.package/IceBranchGroupModel.class/properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"commentStamp" : "CyrilFerlicot 7/9/2017 03:35",
"super" : "IceAbstractBranchModel",
"category" : "Iceberg-UI-Utils",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [
"repository",
"branches",
"groupName"
],
"name" : "IceBranchGroupModel",
"type" : "normal"
}
16 changes: 16 additions & 0 deletions Iceberg-UI.package/IceBranchModel.class/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Description
--------------------

I represent an unique branch. I should be contained in an IceBranchGroupModel.

Examples
--------------------

IceBranchModel parent: anIceBranchGroupModel branch: anIceBranch

Internal Representation and Key Implementation Points.
--------------------

Instance Variables
branch: <anIceBranch> The branch I should display info for.
parentGroup: <anIceBranchGroupModel> The branch group inside of which I am.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
instance creation
parent: anIceBranchGroupModel branch: anIceBranch
^ self new
parentGroup: anIceBranchGroupModel;
branch: anIceBranch;
yourself
3 changes: 3 additions & 0 deletions Iceberg-UI.package/IceBranchModel.class/instance/branch..st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
branch: anIceBranch
branch := anIceBranch
3 changes: 3 additions & 0 deletions Iceberg-UI.package/IceBranchModel.class/instance/branch.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
branch
^ branch
3 changes: 3 additions & 0 deletions Iceberg-UI.package/IceBranchModel.class/instance/children.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
children
^ #()
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
action
compareCurrentToMe
self repository compareCurrentBranchWithBranch: self branch
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
testing
isBranchModel
^ true
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
nameToDisplay
^ self repository descriptionTextForBranch: self branch
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
parentGroup: anIceBranchGroupModel
parentGroup := anIceBranchGroupModel
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
parentGroup
^ parentGroup
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
repository
^ self parentGroup repository
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
accessing
statusForBranch: aBranch
status
| incoming outgoing allStatus |

incoming := aBranch incomingCommits size.
outgoing := aBranch outgoingCommits size.
incoming := self branch incomingCommits size.
outgoing := self branch outgoingCommits size.

allStatus := OrderedCollection new.
(incoming = 0 and: [ outgoing = 0 ]) ifTrue: [ allStatus add: 'Up to date' ].
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
action
switchToMe
self repository switchBranchTo: self branch
14 changes: 14 additions & 0 deletions Iceberg-UI.package/IceBranchModel.class/properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"commentStamp" : "CyrilFerlicot 7/9/2017 03:36",
"super" : "IceAbstractBranchModel",
"category" : "Iceberg-UI-Utils",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [
"parentGroup",
"branch"
],
"name" : "IceBranchModel",
"type" : "normal"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
acessing
nameText
^ self highlight: self package name
^ self highlight: self packageName
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
acessing
packageName
^ self package name
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*Iceberg-UI
branchesFrom: aRepository
"I return all the branches of my remote from a repository"

^ aRepository branches
select: [ :branch | branch isRemote and: [ branch remoteName = self remoteName ] ]
3 changes: 3 additions & 0 deletions Iceberg-UI.package/IceRemote.extension/properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name" : "IceRemote"
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
building
addRepositoryBranchesTo: composite
| branches |

(branches := composite fastTable)
(branches := composite fastTreeTable)
title: 'Branches';
display: #branches;
column: 'Name' evaluated: [ :branch :model | model descriptionTextForBranch: branch ];
column: 'Status' evaluated: [ :branch :model | model statusForBranch: branch ].

display: [ :repository |
| localisations |
localisations := repository remotes collect: [ :remote | IceBranchGroupModel repository: repository remote: remote ] as: OrderedCollection.
repository hasLocalBraches
ifTrue: [ localisations addFirst: (IceBranchGroupModel localFromRepository: repository) ].
localisations ];
children: #children;
column: 'Name' evaluated: #nameToDisplay;
column: 'Status' evaluated: #status;
allExpanded.

"actions"
branches addAction: self branchCreateNewAction.

"selection actions"
branches
branches
addSelectionAction: self branchSwitchAction;
addSelectionAction: self branchCompareWithCurrentAction
addSelectionAction: self branchCompareWithCurrentAction
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ menu actions - branches
branchCompareWithCurrentAction
^ GLMGenericAction new
action: [ :presentation :model |
model compareCurrentBranchWithBranch: presentation selection.
presentation selection compareCurrentToMe.
presentation pane browser update ];
showTitle: 'Compare with current branch';
yourself
enabledCondition: [ :presentation :model | (model isCurrentBranch: presentation selection branch) not ];
condition: [ :presentation | presentation selection ifNil: [ false ] ifNotNil: #isBranchModel ];
showTitle: 'Compare with current branch';
yourself
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ menu actions - branches
branchSwitchAction
^ GLMGenericAction new
action: [ :presentation :model |
model switchBranchTo: presentation selection.
presentation selection switchToMe.
presentation pane browser update ];
showTitle: 'Switch to this branch';
enabledCondition: [ :presentation :model |
(model isCurrentBranch: presentation selection) not ];
showTitle: 'Switch to this branch';
enabledCondition: [ :presentation :model | (model isCurrentBranch: presentation selection branch) not ];
condition: [ :presentation | presentation selection ifNil: [ false ] ifNotNil: #isBranchModel ];
shortcut: $b;
yourself
yourself
Loading

0 comments on commit 4c51bd3

Please sign in to comment.