-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #194 from npasserini/dev-0.3
Preview of version 0.3.1
- Loading branch information
Showing
133 changed files
with
462 additions
and
254 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
Iceberg-Tests.package/IceRepositoryTest.class/instance/scenarioForSwitchBranches.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
scenarios | ||
scenarioForSwitchBranches | ||
"Create a new version of a package in another branch, then remove all code from the image." | ||
|
||
"1 - Commit a new version in a branch" | ||
repository loadPackage: packageName. | ||
repository createBranch: 'forTestingCheckout'. | ||
self theTestClass compile: 'methodInBranch'. | ||
repository | ||
savePackage: packageName | ||
withMessage: 'New method in branch'. | ||
|
||
"2 - Remove all code from the image" | ||
self removeTestPackages. | ||
self deny: (Smalltalk globals includesKey: #Test). | ||
|
||
"3 - Reload package from master branch" | ||
repository checkoutBranch: 'master'. |
6 changes: 6 additions & 0 deletions
6
Iceberg-Tests.package/IceRepositoryTest.class/instance/testBranchIncludesCommit.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
tests - branchs | ||
testBranchIncludesCommit | ||
(self lastCommits: 3) do: [ :commit | | ||
self assert: (repository branch includesCommit: commit) | ||
] | ||
|
2 changes: 1 addition & 1 deletion
2
Iceberg-Tests.package/IceRepositoryTest.class/instance/testBranchName.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
tests - branchs | ||
testBranchName | ||
repository branchName: 'nuevoBranch'. | ||
repository createBranch: 'nuevoBranch'. | ||
self assert: repository branch name equals: 'nuevoBranch'. |
12 changes: 12 additions & 0 deletions
12
Iceberg-Tests.package/IceRepositoryTest.class/instance/testCloneSpecifyingBranch.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
tests - create repository | ||
testCloneSpecifyingBranch | ||
repository checkoutBranch: 'forBecomeWriteable'. | ||
|
||
self assert: repository branchName equals: 'forBecomeWriteable'. | ||
self assert: repository branch name equals: 'forBecomeWriteable'. | ||
self assert: repository backend branch equals: 'forBecomeWriteable'. | ||
self assert: repository backend currentBranch equals: 'forBecomeWriteable'. | ||
|
||
repository loadPackage: packageName. | ||
self assert: ((Smalltalk at: #Test) canUnderstand: #forBecomeWritable) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
Iceberg-Tests.package/IceRepositoryTest.class/instance/testMetacelloIntegration.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
tests - create repository | ||
testMetacelloIntegration | ||
self assert: (IceRepository registry noneSatisfy: [ :repo | repo origin projectName = projectName ]). | ||
|
||
Metacello new | ||
baseline: 'PharoGitTest'; | ||
repository: 'github://npasserini/', projectName; | ||
load. | ||
|
||
repository := IceRepository registry | ||
detect: [ :repo | repo origin projectName = projectName ] | ||
ifNone: [ self fail: 'Could not find repository for project: ', projectName ]. | ||
|
||
self assert: (repository loadedCode loadedVersions noneSatisfy: [ :version | version isKindOf: IceForeignVersion ]). | ||
self assert: ((repository loadedCode versionFor: (repository packageNamed: packageName)) isKindOf: IceSavedPackageVersion ). | ||
self assert: repository incommingCommits isEmpty. | ||
self assert: repository outgoingCommits isEmpty. |
22 changes: 22 additions & 0 deletions
22
Iceberg-Tests.package/IceRepositoryTest.class/instance/testMetacelloIntegrationForTags.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
tests - create repository | ||
testMetacelloIntegrationForTags | ||
self assert: (IceRepository registry noneSatisfy: [ :repo | repo origin projectName = projectName ]). | ||
|
||
Metacello new | ||
baseline: 'PharoGitTest'; | ||
repository: 'github://npasserini/', projectName, ':1.2.3'; | ||
load. | ||
|
||
repository := IceRepository registry | ||
detect: [ :repo | repo origin projectName = projectName ] | ||
ifNone: [ self fail: 'Could not find repository for project: ', projectName ]. | ||
|
||
self assert: (repository loadedCode loadedVersions noneSatisfy: [ :version | version isKindOf: IceForeignVersion ]). | ||
self assert: ((repository loadedCode versionFor: (repository packageNamed: packageName)) isKindOf: IceSavedPackageVersion ). | ||
self assert: repository incommingCommits isEmpty. | ||
self assert: repository outgoingCommits isEmpty. | ||
|
||
repository loadedPackages do: [ :package | | ||
self assert: package incommingCommits isEmpty. | ||
self assert: package outgoingCommits isEmpty | ||
]. |
3 changes: 3 additions & 0 deletions
3
Iceberg-Tests.package/IceRepositoryTest.class/instance/theTestClass.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
auxiliar | ||
theTestClass | ||
^ Smalltalk at: #Test |
5 changes: 5 additions & 0 deletions
5
Iceberg.package/IceAbstractCommitWalk.class/instance/includesCommit..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
walking | ||
includesCommit: aCommit | ||
self commitsDo: [ :commit | | ||
commit id = aCommit id ifTrue: [ ^ true ]]. | ||
^ false |
3 changes: 3 additions & 0 deletions
3
Iceberg.package/IceAbstractCommitWalk.class/instance/uptoBranch..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
walk definition | ||
uptoBranch: anIceBranch | ||
self uptoCommit: anIceBranch lastCommit |
3 changes: 3 additions & 0 deletions
3
Iceberg.package/IceAbstractCommitWalk.class/instance/uptoBranches..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
walk definition | ||
uptoBranches: branches | ||
^ branches do: [ :branch | self uptoBranch: branch ] |
33 changes: 16 additions & 17 deletions
33
Iceberg.package/IceAbstractModel.class/instance/highlight..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,22 @@ | ||
highlighting | ||
highlight: aString | ||
"entity could be a repository or a package" | ||
[ | ||
| text modified incomming outgoing | | ||
text := Text fromString: aString. | ||
|
||
| text modified incomming outgoing | | ||
text := Text fromString: aString. | ||
self repository isMissing ifTrue: [ ^ text allBold; makeAllColor: self colorError ]. | ||
self isLoaded ifFalse: [ ^ text makeAllColor: self colorNotLoaded ]. | ||
|
||
self repository isMissing ifTrue: [ ^ text allBold; makeAllColor: self colorError ]. | ||
self isLoaded ifFalse: [ ^ text makeAllColor: self colorNotLoaded ]. | ||
modified := entity isModified. | ||
incomming := self incommingCommits notEmpty. | ||
outgoing := self outgoingCommits notEmpty. | ||
|
||
modified := entity isModified. | ||
incomming := self incommingCommits notEmpty. | ||
outgoing := self outgoingCommits notEmpty. | ||
modified ifTrue: [ text prepend: '* ' ]. | ||
modified | incomming | outgoing ifTrue: [ text allBold ]. | ||
|
||
modified ifTrue: [ text prepend: '* ' ]. | ||
modified | incomming | outgoing ifTrue: [ text allBold ]. | ||
|
||
modified ifTrue: [ ^ text makeAllColor: self colorModified ]. | ||
incomming ifTrue: [ ^ text makeAllColor: self colorIncomming ]. | ||
outgoing ifTrue: [ ^ text makeAllColor: self colorOutgoing ]. | ||
^ text | ||
|
||
"Color darkGray" | ||
modified ifTrue: [ ^ text makeAllColor: self colorModified ]. | ||
incomming ifTrue: [ ^ text makeAllColor: self colorIncomming ]. | ||
outgoing ifTrue: [ ^ text makeAllColor: self colorOutgoing ]. | ||
^ text | ||
] | ||
on: Error do: [ ^ aString ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
testing | ||
isLoaded | ||
self subclassResponsibility |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
accessing | ||
testing | ||
isMissing | ||
^ self repository isMissing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
accessing | ||
testing | ||
isOperative | ||
^ self repository isMissing not |
3 changes: 3 additions & 0 deletions
3
Iceberg.package/IceAbstractModel.class/instance/repository.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
repository | ||
self subclassResponsibility |
30 changes: 16 additions & 14 deletions
30
Iceberg.package/IceAbstractModel.class/instance/status.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
accessing | ||
status | ||
"entity could be a repository or a package" | ||
|
||
| status incomming outgoing | | ||
self repository isMissing ifTrue: [ ^ 'Local repository missing' asText allBold makeAllColor: self colorError ]. | ||
self isLoaded ifFalse: [ ^ 'Not loaded.' ]. | ||
|
||
status := OrderedCollection new. | ||
entity isModified ifTrue: [ status add: 'Uncommited changes' ]. | ||
|
||
incomming := self incommingCommits size. | ||
incomming > 0 ifTrue: [ status add: ('{1} incomming' format: { incomming })]. | ||
|
||
outgoing := self outgoingCommits size. | ||
outgoing > 0 ifTrue: [ status add: ('{1} not published' format: { outgoing })]. | ||
[ | ||
| status incomming outgoing | | ||
self repository isMissing ifTrue: [ ^ 'Local repository missing' asText allBold makeAllColor: self colorError ]. | ||
self isLoaded ifFalse: [ ^ 'Not loaded.' ]. | ||
|
||
^ status ifEmpty: 'Up to date' ifNotEmpty: [ ', ' join: status ] | ||
status := OrderedCollection new. | ||
entity isModified ifTrue: [ status add: 'Uncommited changes' ]. | ||
|
||
incomming := self incommingCommits size. | ||
incomming > 0 ifTrue: [ status add: ('{1} incomming' format: { incomming })]. | ||
|
||
outgoing := self outgoingCommits size. | ||
outgoing > 0 ifTrue: [ status add: ('{1} not published' format: { outgoing })]. | ||
|
||
^ status ifEmpty: 'Up to date' ifNotEmpty: [ ', ' join: status ] | ||
] | ||
on: Error do: [ :error | ^ error description asText makeAllColor: self colorError ] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Base class for different types of versions, namely: IceVersion (normal versions) and IceForeignVersion (versions not managed by Ice). |
2 changes: 1 addition & 1 deletion
2
...IceForeignVersion.class/class/package..st → ...bstractVersion.class/class/forPackage..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
instance creation | ||
package: package | ||
forPackage: package | ||
^ self new package: package; yourself |
3 changes: 3 additions & 0 deletions
3
Iceberg.package/IceAbstractVersion.class/instance/beCurrent.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
as yet unclassified | ||
beCurrent | ||
"By default do not to anything, version should have a package manager that makes them current without Iceberg intervention." |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
patches | ||
updated | ||
^ self |
3 changes: 3 additions & 0 deletions
3
Iceberg.package/IceAbstractVersion.class/instance/updatedVersion.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
patches | ||
updatedVersion | ||
^ self |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"category" : "Iceberg-Core", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "NicoPasserini 10/20/2016 15:48", | ||
"instvars" : [ | ||
"package" ], | ||
"name" : "IceAbstractVersion", | ||
"pools" : [ | ||
], | ||
"super" : "Object", | ||
"type" : "normal" } |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
commits | ||
commits | ||
self ensureCommitsLoaded. | ||
^ commits | ||
^ self repository newCommitWalk fromBranch: self; commits |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
commits | ||
commitsNotIn: anotherBranch | ||
^ self commits copyWithoutAll: anotherBranch commits | ||
^ self repository newCommitWalk | ||
fromBranch: self; | ||
uptoBranch: anotherBranch; | ||
commits |
3 changes: 0 additions & 3 deletions
3
Iceberg.package/IceBranch.class/instance/ensureCommitsLoaded.st
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
commits | ||
includesCommit: commit | ||
^ self commits includes: commit | ||
^ self lastCommit isDescendantOf: commit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
commits | ||
incommingCommits | ||
^ self upstream | ||
ifNotNil: [ self upstream commitsNotIn: self ] | ||
ifNil: [ #() ] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
commits | ||
outgoingCommits | ||
^ self outgoingCommitsWalk commits |
10 changes: 10 additions & 0 deletions
10
Iceberg.package/IceBranch.class/instance/outgoingCommitsWalk.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
commits | ||
outgoingCommitsWalk | ||
| walk | | ||
walk := self repository newCommitWalk fromBranch: self. | ||
self upstream | ||
ifNotNil: [ walk uptoBranch: self upstream ] | ||
ifNil: [ walk uptoBranches: ( | ||
self repository localBranches copyWithout: self) ]. | ||
|
||
^ walk. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
private | ||
refresh | ||
commits := nil. | ||
upstream ifNotNil: #refresh. | ||
versionDictionary := Dictionary new. |
Oops, something went wrong.