-
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 #447 from pharo-vcs/dev-0.5
fixes restore clone
- Loading branch information
Showing
43 changed files
with
193 additions
and
47 deletions.
There are no files selected for viewing
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
6 changes: 2 additions & 4 deletions
6
Iceberg-UI.package/IceAbstractModel.class/class/compactIfNeeded.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,7 +1,5 @@ | ||
private | ||
compactIfNeeded | ||
| newModelCache | | ||
self models size > 250 ifFalse: [ ^ self ]. | ||
newModelCache := self models select: [ :each | each notNil ]. | ||
modelCache := newModelCache | ||
|
||
"it looks like rehash will do what I need :)" | ||
modelCache rehash |
21 changes: 9 additions & 12 deletions
21
Iceberg-UI.package/IceAbstractModel.class/class/modelFor..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,17 +1,14 @@ | ||
instance creation | ||
modelFor: entity | ||
| model | | ||
"We are using WeakValueDictionary to keep this sinchronized (in case you have more than | ||
one window open, you want always same model). Now, it has to be cleaned when windows are | ||
no longer around, but associations will be nil... so we cannot use a simple ifAbsentPut:. | ||
Yep, ugly... but effective." | ||
|
||
model := self models at: entity name ifAbsent: [ nil ]. | ||
"We are using a WeakSet for keeping models because using a dictionary (sorted by | ||
name) has problems when cleaning. This should be efficient enough, but we'll see." | ||
model := self models | ||
detect: [ :each | each notNil and: [ each entity name = entity name ] ] | ||
ifNone: [ nil ]. | ||
^ model ifNil: [ | ||
self compactIfNeeded. | ||
self models | ||
at: entity name | ||
put: (self basicNew | ||
entity: entity; | ||
initialize; | ||
yourself) ] | ||
self models add: (self basicNew | ||
entity: entity; | ||
initialize; | ||
yourself) ] |
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
2 changes: 1 addition & 1 deletion
2
Iceberg-UI.package/IceCachedValue.class/instance/invalidateOn.from..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 @@ | ||
initialization | ||
invalidateOn: announcementType from: announcer | ||
announcer subscribe: announcementType send: #reset to: self | ||
announcer when: announcementType send: #reset to: self |
3 changes: 3 additions & 0 deletions
3
Iceberg-UI.package/IceCloneRepositoryModel.class/instance/configureRepository..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 @@ | ||
private | ||
configureRepository: aRepository | ||
aRepository register |
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
10 changes: 10 additions & 0 deletions
10
Iceberg-UI.package/IceCreateRepositoryModel.class/instance/guessSubDirectory.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 @@ | ||
actions | ||
guessSubDirectory | ||
"If a '.filetree' file, there is a high chance that this is a smalltalk code directory. In that case, the directory containing it is probably the subdirectory of the repository." | ||
|
||
| location | | ||
location := localDirectoryLocation location. | ||
location files | ||
detect: [ :file | file basename = '.filetree' ] | ||
ifFound: [ :dir | subdirectory text: '' ] | ||
ifNone: [ location directories do: [ :directory | directory files detect: [ :file | file basename = '.filetree' ] ifFound: [ :file | subdirectory text: directory basename ] ] ] |
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
5 changes: 5 additions & 0 deletions
5
Iceberg-UI.package/IceLocationModel.class/instance/onChoose..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 @@ | ||
hook | ||
onChoose: aBlockClosure | ||
"I allow to set a hook to execute when the user select a location." | ||
|
||
chooseBlock := aBlockClosure |
3 changes: 3 additions & 0 deletions
3
Iceberg-UI.package/IceLocationModel.class/instance/onChoose.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 @@ | ||
hook | ||
onChoose | ||
^ chooseBlock |
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
3 changes: 1 addition & 2 deletions
3
Iceberg-UI.package/IceRepositoryModel.class/instance/restore.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,3 @@ | ||
actions | ||
restore | ||
self repository backend cloneRepository. | ||
self repository refresh. | ||
(IceRestoreRepositoryModel repository: self repository) openWithSpec |
Empty file.
3 changes: 3 additions & 0 deletions
3
Iceberg-UI.package/IceRestoreRepositoryModel.class/class/new.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 @@ | ||
instance creation | ||
new | ||
self error: 'Use #repository:' |
5 changes: 5 additions & 0 deletions
5
Iceberg-UI.package/IceRestoreRepositoryModel.class/class/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,5 @@ | ||
instance creation | ||
repository: aRepository | ||
^ self basicNew | ||
initializeRepository: aRepository; | ||
yourself |
6 changes: 6 additions & 0 deletions
6
Iceberg-UI.package/IceRestoreRepositoryModel.class/instance/configureRepository..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 @@ | ||
private | ||
configureRepository: aRepository | ||
repository location = aRepository location | ||
ifFalse: [ repository location: aRepository location ]. | ||
repository subdirectory = aRepository subdirectory | ||
ifFalse: [ repository subdirectory: aRepository subdirectory ] |
8 changes: 8 additions & 0 deletions
8
Iceberg-UI.package/IceRestoreRepositoryModel.class/instance/initializeRepository..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,8 @@ | ||
initialization | ||
initializeRepository: aRepository | ||
repository := aRepository. | ||
self initialize. | ||
repository location ifNotNil: [ | ||
remoteUrl text: repository origin url. | ||
localDirectoryLocation location: repository location ]. | ||
subdirectory text: repository subdirectory |
13 changes: 13 additions & 0 deletions
13
Iceberg-UI.package/IceRestoreRepositoryModel.class/properties.json
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,13 @@ | ||
{ | ||
"commentStamp" : "", | ||
"super" : "IceCloneRepositoryModel", | ||
"category" : "Iceberg-UI-View", | ||
"classinstvars" : [ ], | ||
"pools" : [ ], | ||
"classvars" : [ ], | ||
"instvars" : [ | ||
"repository" | ||
], | ||
"name" : "IceRestoreRepositoryModel", | ||
"type" : "normal" | ||
} |
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 @@ | ||
SystemOrganization addCategory: #'Iceberg-UI'! | ||
SystemOrganization addCategory: 'Iceberg-UI-Model'! | ||
SystemOrganization addCategory: 'Iceberg-UI-Utils'! | ||
SystemOrganization addCategory: 'Iceberg-UI-View'! | ||
SystemOrganization addCategory: #'Iceberg-UI-Model'! | ||
SystemOrganization addCategory: #'Iceberg-UI-Utils'! | ||
SystemOrganization addCategory: #'Iceberg-UI-View'! |
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 @@ | ||
querying | ||
mergeBaseWith: anotherCommit | ||
^ self repository commitAt: | ||
(self repository backend mergeBaseBetween: self id and: anotherCommit id) | ||
(self repository mergeBaseBetween: self id and: anotherCommit id) |
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
Empty file.
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 @@ | ||
instance creation | ||
for: aRepository | ||
^ self basicNew | ||
initializeRepository: aRepository; | ||
yourself |
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 @@ | ||
instance creation | ||
new | ||
self error: '#for:' |
4 changes: 4 additions & 0 deletions
4
Iceberg.package/IceLog.class/instance/cypressClassOrTraitName..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,4 @@ | ||
private | ||
cypressClassOrTraitName: aMethod | ||
^ aMethod origin name, (self cypressMethodClassExtension: aMethod) | ||
|
5 changes: 5 additions & 0 deletions
5
Iceberg.package/IceLog.class/instance/cypressMethodClassExtension..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 @@ | ||
private | ||
cypressMethodClassExtension: aMethod | ||
aMethod isExtension ifTrue: [ ^ '.extension' ]. | ||
aMethod origin isTrait ifTrue: [ ^ '.trait' ]. | ||
^ '.class' |
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 @@ | ||
private | ||
cypressMethodName: aMethod | ||
^ (MCFileTreeStCypressWriter fileNameForSelector: aMethod selector asString), '.st' |
5 changes: 5 additions & 0 deletions
5
Iceberg.package/IceLog.class/instance/cypressMethodSideName..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 @@ | ||
private | ||
cypressMethodSideName: aMethod | ||
^ aMethod origin isClassSide | ||
ifTrue: [ 'class' ] | ||
ifFalse: [ 'instance' ] |
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 @@ | ||
private | ||
cypressPackageName: aPackage | ||
^ aPackage name, '.package' |
15 changes: 15 additions & 0 deletions
15
Iceberg.package/IceLog.class/instance/fileNameForMethod..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,15 @@ | ||
private | ||
fileNameForMethod: aMethod | ||
| path | | ||
|
||
path := OrderedCollection new. | ||
self repository subdirectory | ||
ifNotEmpty: [ :subDir | path add: subDir ]. | ||
path | ||
add: (self cypressPackageName: aMethod origin package); | ||
add: (self cypressClassOrTraitName: aMethod); | ||
add: (self cypressMethodSideName: aMethod); | ||
add: (self cypressMethodName: aMethod). | ||
|
||
^ String streamContents: [ :stream | | ||
path asStringOn: stream delimiter: '/' ] |
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,27 @@ | ||
accessing | ||
historyOfMethod: aMethod | ||
| path commit pathSpec options history | | ||
|
||
path := self fileNameForMethod: aMethod. | ||
|
||
commit := self repository branch lastCommit. | ||
pathSpec := LGitPathSpec withAll: { path }. | ||
options := LGitDiffOptions defaults. | ||
options pathspec: (LGitStringArray withAll: { path }). | ||
|
||
history := OrderedCollection new. | ||
self repository newCommitWalk | ||
fromCommit: commit; | ||
rawResultsDo: [ :eachCommit | | parents tree | | ||
parents := eachCommit numberOfParents. | ||
tree := eachCommit tree. | ||
parents = 0 | ||
ifTrue: [ | ||
(tree matchesPathSpec: pathSpec) | ||
ifTrue: [ history add: eachCommit ] ] | ||
ifFalse: [ | ||
eachCommit parents do: [ :eachParent | | diff | | ||
diff := tree diffTo: eachParent tree options: options. | ||
diff numberOfDeltas > 0 | ||
ifTrue: [ history add: eachCommit ] ] ] ]. | ||
^ history collect: [ :each | IceLibgitLocalRepository parseCommitInfo: each ] |
4 changes: 4 additions & 0 deletions
4
Iceberg.package/IceLog.class/instance/initializeRepository..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,4 @@ | ||
initialization | ||
initializeRepository: aRepository | ||
repository := aRepository. | ||
self initialize |
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 | ||
^ repository |
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,13 @@ | ||
{ | ||
"commentStamp" : "", | ||
"super" : "Object", | ||
"category" : "Iceberg-Changes", | ||
"classinstvars" : [ ], | ||
"pools" : [ ], | ||
"classvars" : [ ], | ||
"instvars" : [ | ||
"repository" | ||
], | ||
"name" : "IceLog", | ||
"type" : "normal" | ||
} |
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 | ||
log | ||
^ IceLog for: 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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
SystemOrganization addCategory: #Iceberg! | ||
SystemOrganization addCategory: 'Iceberg-Adapters'! | ||
SystemOrganization addCategory: 'Iceberg-Announcements'! | ||
SystemOrganization addCategory: 'Iceberg-Changes'! | ||
SystemOrganization addCategory: 'Iceberg-Core'! | ||
SystemOrganization addCategory: 'Iceberg-Core-Remotes'! | ||
SystemOrganization addCategory: 'Iceberg-Errors'! | ||
SystemOrganization addCategory: 'Iceberg-Security'! | ||
SystemOrganization addCategory: #'Iceberg-Adapters'! | ||
SystemOrganization addCategory: #'Iceberg-Announcements'! | ||
SystemOrganization addCategory: #'Iceberg-Changes'! | ||
SystemOrganization addCategory: #'Iceberg-Core'! | ||
SystemOrganization addCategory: #'Iceberg-Core-Remotes'! | ||
SystemOrganization addCategory: #'Iceberg-Errors'! | ||
SystemOrganization addCategory: #'Iceberg-Security'! |