Skip to content

Commit

Permalink
Merge pull request #20 from npasserini/newChangeSets
Browse files Browse the repository at this point in the history
This closes #12 and closes #7Replaced changeset model to allow for …
  • Loading branch information
npasserini committed May 13, 2016
2 parents d00f258 + 46d4a7b commit 83b0c4a
Show file tree
Hide file tree
Showing 67 changed files with 177 additions and 148 deletions.
4 changes: 2 additions & 2 deletions SVS-Git.package/IceChangeSet.class/properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
],
"commentStamp" : "NicoPasserini 5/9/2016 18:11",
"instvars" : [
"elements" ],
],
"name" : "IceChangeSet",
"pools" : [
],
"super" : "Object",
"super" : "IceDiff",
"type" : "normal" }
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
],
"commentStamp" : "",
"instvars" : [
"description" ],
"name" : "IceSimpleChangeSet",
],
"name" : "IceChangeSetChanged",
"pools" : [
],
"super" : "IceChangeSet",
"super" : "Announcement",
"type" : "normal" }
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ initializeWidgets
rootNodeHolder: [ :item |
IceChangesTreeNodeModel new
content: item;
children: [ tree childrenFor: item ];
yourself ];
yourself.

Expand Down
5 changes: 3 additions & 2 deletions SVS-Git.package/IceChangesTreeView.class/instance/model..st
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
api
model: newModel
model value: newModel
model: anIceChangeSet
model value: anIceChangeSet.
anIceChangeSet whenChangedDo: [ self tree updateTree. ]

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
instance creation
class: aClass parent: anIcePackageChangeSet
^ self new
targetClass: aClass;
parent: anIcePackageChangeSet;
yourself.
14 changes: 14 additions & 0 deletions SVS-Git.package/IceClassChangeSet.class/instance/analyseChanges.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
private
analyseChanges
| newChanges |
newChanges := self parent changes select: [ :operation |
operation targetClass = self targetClass ].

newChanges
detect: [ :operation | operation definition isClassDefinition ]
ifFound: [ :classDef |
classDefinition := classDef.
changes := newChanges copyWithout: classDef.
]
ifNone: [ changes := newChanges ].

3 changes: 3 additions & 0 deletions SVS-Git.package/IceClassChangeSet.class/instance/changes.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
changes
^ changes ifNil: [ self analyseChanges. changes ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
classDefinition
^ classDefinition ifNil: [ self analyseChanges. classDefinition ]
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
initialization
initialElements
^ self operations collect: #asIceChangeSet
^ self changes collect: #asIceChangeSet
10 changes: 0 additions & 10 deletions SVS-Git.package/IceClassChangeSet.class/instance/operations..st

This file was deleted.

This file was deleted.

10 changes: 10 additions & 0 deletions SVS-Git.package/IceClassChangeSet.class/instance/updateDiff..st
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*SVS-Git-UI
updateDiff: aDiffModel
self classDefinition
ifNil: [ super updateDiff: aDiffModel ]
ifNotNil: [ :cd |
aDiffModel
contextClass: nil;
leftText: cd toSource;
rightText: cd fromSource
]
4 changes: 2 additions & 2 deletions SVS-Git.package/IceClassChangeSet.class/properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"commentStamp" : "",
"instvars" : [
"targetClass",
"operations",
"classDefinition" ],
"classDefinition",
"changes" ],
"name" : "IceClassChangeSet",
"pools" : [
],
Expand Down
5 changes: 4 additions & 1 deletion SVS-Git.package/IceCommitModel.class/class/defaultSpec.st
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@ defaultSpec
^ SpecLayout composed newColumn:
[ :col | col
add: #message;
add: #commitButton height: self toolbarHeight
newRow: [ :row | row
add: #commitButton;
add: #refreshButton
] height: self toolbarHeight
]
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
initialization
initializePresenter
message acceptBlock: [ :text |
text ifNotEmpty: [ self model commitWithMessage: text asString ] ].
commitButton action: [ message accept ]
text ifNotEmpty: [ self model commitWithMessage: text asString. ] ].
commitButton action: [ message accept ].
refreshButton action: [ self model refresh ]
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ initializeWidgets
commitButton := self newButton
label: 'Commit';
yourself.

refreshButton := self newButton
label: 'Refresh changes';
yourself.

self focusOrder
add: message.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
refreshButton
^ refreshButton
3 changes: 2 additions & 1 deletion SVS-Git.package/IceCommitModel.class/properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"instvars" : [
"message",
"commitButton",
"model" ],
"model",
"refreshButton" ],
"name" : "IceCommitModel",
"pools" : [
],
Expand Down
1 change: 1 addition & 0 deletions SVS-Git.package/IceDiff.class/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Parent class for any comparison between two versions of the code (working copy, commit or other) and comprising any level of granularity (a whole repository, a package, a class, etc.).
4 changes: 4 additions & 0 deletions SVS-Git.package/IceDiff.class/instance/initialize.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
initialization
initialize
super initialize.
announcer := Announcer new.
4 changes: 4 additions & 0 deletions SVS-Git.package/IceDiff.class/instance/refresh.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
actions
refresh
elements ifNotNil: [ elements do: #refresh ].
announcer announce: IceChangeSetChanged new.
3 changes: 3 additions & 0 deletions SVS-Git.package/IceDiff.class/instance/whenChangedDo..st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
events
whenChangedDo: aBlock
announcer when: IceChangeSetChanged do: aBlock
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
],
"classvars" : [
],
"commentStamp" : "",
"commentStamp" : "NicoPasserini 5/12/2016 17:23",
"instvars" : [
"repository" ],
"name" : "IceRepositoryChangeSet",
"elements",
"announcer" ],
"name" : "IceDiff",
"pools" : [
],
"super" : "IceStructuralChangeSet",
"super" : "Object",
"type" : "normal" }
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
examples - change tree
exampleChangesTree2
| ds git changes |
git := Git new origin: '[email protected]:npasserini/pharo-git.git'.
changes := IceRepositoryChangeSet fromRepository: git.
| repository changeSet ds |
repository := Git new origin: '[email protected]:npasserini/pharo-git-test.git'.
changeSet := IceWorkingCopyDiff forRepository: repository.
ds := FTTreeDataSource
roots: (changes elements sort: [ :a :b | a name < b name ])
roots: (changeSet elements sort: [ :a :b | a name < b name ])
children: [ :data | data elements sort: [ :a :b | a name < b name ] ].
FTTableMorph new
extent: 200 @ 400;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
examples - change tree
exampleChangesTreeOnIcebergPackage
| git changes |
git := Git new origin: '[email protected]:npasserini/pharo-git.git'.
changes := IceRepositoryChangeSet fromRepository: git.
| repository changeSet |
repository := Git new origin: '[email protected]:npasserini/pharo-git-test.git'.
changeSet := IceWorkingCopyDiff forRepository: repository.
IceChangesTreeView new
model: changes;
model: changeSet;
openWithSpec.
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
examples - change tree
exampleChangesTreeOnTestPackage
| git changes |
Transcript show: '----------------------------------'; cr.
git := Git new origin: '[email protected]:npasserini/pharo-git-test.git'.
changes := IceRepositoryChangeSet fromRepository: git.
| repository changeSet |
repository := Git new origin: '[email protected]:npasserini/pharo-git-test.git'.
changeSet := IceWorkingCopyDiff forRepository: repository.
IceChangesTreeView new
model: changes;
model: changeSet;
openWithSpec.

Transcript flush.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
examples - change tree
exampleSynchronizer
| repository changeSet |
repository := Git new origin: '[email protected]:npasserini:repackaging/pharo-git.git'.
changeSet := IceRepositoryChangeSet fromRepository: repository.
repository := Git new origin: '[email protected]:npasserini/pharo-git.git'; branch: 'newChangeSets'.
changeSet := IceWorkingCopyDiff forRepository: repository.
IceSynchronizer new
changeSet: changeSet;
openWithSpec.

This file was deleted.

1 change: 1 addition & 0 deletions SVS-Git.package/IcePackageChangeSet.class/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Provides a filtered version of a diff, restricted to a package.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
instance creation
package: aPackage parent: anIceDiff
^ self new
package: aPackage;
parent: anIceDiff;
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
initialization
changedClasses
^ self changes collect: #targetClass as: Set
4 changes: 4 additions & 0 deletions SVS-Git.package/IcePackageChangeSet.class/instance/changes.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
initialization
changes
^ self parent changes select: [ :change |
change targetClass notNil and: [ change targetClass package mcPackage = self package ] ]
Original file line number Diff line number Diff line change
@@ -1,29 +1,3 @@
initialization
initialElements
| changeSets localChanges extensionChanges |

changeSets := (((self patch operations
"If class is nil it represents a package operation,
which is not persisted in current file format."
select: [ :op | op targetClass notNil ])
groupedBy: #targetClass)
associations collect: [:assoc |
IceClassChangeSet class: assoc key operations: assoc value])
groupedBy: [ :changeSet | self isExtension: changeSet ].


localChanges := changeSets at: false ifAbsent: {}.
extensionChanges := changeSets at: true
ifPresent: [:extensions |
{ IceSimpleChangeSet
description: '* extension methods'
elements: extensions }]
ifAbsent: {}.

^ localChanges, extensionChanges

"[ :op | | targetClass |
targetClass := op targetClass.
targetClass package = self package correspondingRPackage
ifTrue: [targetClass]
ifFalse: ['* extension methods']]"
^ self changedClasses collect: [:class | IceClassChangeSet class: class parent: self ]
3 changes: 0 additions & 3 deletions SVS-Git.package/IcePackageChangeSet.class/instance/mine..st

This file was deleted.

3 changes: 0 additions & 3 deletions SVS-Git.package/IcePackageChangeSet.class/instance/mine.st

This file was deleted.

3 changes: 0 additions & 3 deletions SVS-Git.package/IcePackageChangeSet.class/instance/patch.st

This file was deleted.

4 changes: 4 additions & 0 deletions SVS-Git.package/IcePackageChangeSet.class/instance/refresh.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
actions
refresh
super refresh.
elements := nil.
3 changes: 0 additions & 3 deletions SVS-Git.package/IcePackageChangeSet.class/instance/theirs..st

This file was deleted.

3 changes: 0 additions & 3 deletions SVS-Git.package/IcePackageChangeSet.class/instance/theirs.st

This file was deleted.

7 changes: 2 additions & 5 deletions SVS-Git.package/IcePackageChangeSet.class/properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@
],
"classvars" : [
],
"commentStamp" : "",
"commentStamp" : "NicoPasserini 5/12/2016 17:32",
"instvars" : [
"package",
"mine",
"theirs",
"patch" ],
"package" ],
"name" : "IcePackageChangeSet",
"pools" : [
],
Expand Down

This file was deleted.

This file was deleted.

Empty file.
Loading

0 comments on commit 83b0c4a

Please sign in to comment.