diff --git a/Iceberg-Libgit.package/IceLibgitLocalRepository.class/instance/cloneRepositoryFrom.branch..st b/Iceberg-Libgit.package/IceLibgitLocalRepository.class/instance/cloneRepositoryFrom.branch..st index fa91eacec7..c5d1f514a6 100644 --- a/Iceberg-Libgit.package/IceLibgitLocalRepository.class/instance/cloneRepositoryFrom.branch..st +++ b/Iceberg-Libgit.package/IceLibgitLocalRepository.class/instance/cloneRepositoryFrom.branch..st @@ -7,10 +7,12 @@ cloneRepositoryFrom: aRemote branch: aBranchName | repo cloneOptions | repo := LGitRepository on: self location. cloneOptions := LGitCloneOptions withCredentialsProvider: IceCredentialsProvider default. - + cloneOptions checkoutOptions checkoutStrategy: LGitCheckoutStrategyEnum git_checkout_none. repo clone: url options: cloneOptions. - aBranchName ifNotNil: [ - repo checkout: aBranchName ]. + repo checkout: (aBranchName ifNil: [ + self branch + ifNotNil: [ :b | b name ] + ifNil: [ 'master' ] ]). (LGitRemote of: repo named: 'origin') lookup; diff --git a/Iceberg-UI.package/IceCachedValue.class/instance/invalidateOn.from..st b/Iceberg-UI.package/IceCachedValue.class/instance/invalidateOn.from..st index 58592717c7..ffed264ff0 100644 --- a/Iceberg-UI.package/IceCachedValue.class/instance/invalidateOn.from..st +++ b/Iceberg-UI.package/IceCachedValue.class/instance/invalidateOn.from..st @@ -1,3 +1,3 @@ initialization invalidateOn: announcementType from: announcer - announcer subscribe: announcementType send: #reset to: self \ No newline at end of file + announcer when: announcementType send: #reset to: self \ No newline at end of file diff --git a/Iceberg-UI.package/IceCloneRepositoryModel.class/instance/configureRepository..st b/Iceberg-UI.package/IceCloneRepositoryModel.class/instance/configureRepository..st new file mode 100644 index 0000000000..f091fe9f39 --- /dev/null +++ b/Iceberg-UI.package/IceCloneRepositoryModel.class/instance/configureRepository..st @@ -0,0 +1,3 @@ +private +configureRepository: aRepository + aRepository register \ No newline at end of file diff --git a/Iceberg-UI.package/IceCloneRepositoryModel.class/instance/createRepository.st b/Iceberg-UI.package/IceCloneRepositoryModel.class/instance/createRepository.st index 7c7bc081bc..1d8028f314 100644 --- a/Iceberg-UI.package/IceCloneRepositoryModel.class/instance/createRepository.st +++ b/Iceberg-UI.package/IceCloneRepositoryModel.class/instance/createRepository.st @@ -8,7 +8,7 @@ createRepository location: self location; subdirectory: subdirectory text; createRepository. - repository register. + self configureRepository: repository. self window delete. ] diff --git a/Iceberg-UI.package/IceCreateRepositoryModel.class/instance/guessSubDirectory.st b/Iceberg-UI.package/IceCreateRepositoryModel.class/instance/guessSubDirectory.st new file mode 100644 index 0000000000..00e59f76fb --- /dev/null +++ b/Iceberg-UI.package/IceCreateRepositoryModel.class/instance/guessSubDirectory.st @@ -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 ] ] ] \ No newline at end of file diff --git a/Iceberg-UI.package/IceCreateRepositoryModel.class/instance/initializeWidgets.st b/Iceberg-UI.package/IceCreateRepositoryModel.class/instance/initializeWidgets.st index 6e75e70bd2..39b3ea51f5 100644 --- a/Iceberg-UI.package/IceCreateRepositoryModel.class/instance/initializeWidgets.st +++ b/Iceberg-UI.package/IceCreateRepositoryModel.class/instance/initializeWidgets.st @@ -2,6 +2,7 @@ initialization initializeWidgets localDirectoryLocation := self instantiate: IceDirectoryModel. localDirectoryLocation + onChoose: [ self guessSubDirectory ]; label: 'Local directory'; chooseTitle: 'Choose local repository'; location: self defaultLocation. diff --git a/Iceberg-UI.package/IceDiffChangeTreeBuilder.class/instance/buildOn..st b/Iceberg-UI.package/IceDiffChangeTreeBuilder.class/instance/buildOn..st index a20f07a5fe..35aa788a01 100644 --- a/Iceberg-UI.package/IceDiffChangeTreeBuilder.class/instance/buildOn..st +++ b/Iceberg-UI.package/IceDiffChangeTreeBuilder.class/instance/buildOn..st @@ -14,7 +14,7 @@ buildOn: aPresenter onChangeOfPort: #entity act: [ :presentation | self diff ifNotNil: [ self diff announcer - subscribe: IceChangeSetChanged + when: IceChangeSetChanged send: #execute: to: (IceChangesTreeResetSelectionHelper for: presentation) ] ]; yourself \ No newline at end of file diff --git a/Iceberg-UI.package/IceDiffCherryPickChangeTreeBuilder.class/instance/buildOn..st b/Iceberg-UI.package/IceDiffCherryPickChangeTreeBuilder.class/instance/buildOn..st index 3b315f926b..41da3ece01 100644 --- a/Iceberg-UI.package/IceDiffCherryPickChangeTreeBuilder.class/instance/buildOn..st +++ b/Iceberg-UI.package/IceDiffCherryPickChangeTreeBuilder.class/instance/buildOn..st @@ -16,7 +16,7 @@ buildOn: aPresenter onChangeOfPort: #entity act: [ :presentation | self diff ifNotNil: [ self diff announcer - subscribe: IceChangeSetChanged + when: IceChangeSetChanged send: #execute: to: (IceChangesTreeResetSelectionHelper for: presentation) ] ]; yourself \ No newline at end of file diff --git a/Iceberg-UI.package/IceLocationModel.class/instance/choose.st b/Iceberg-UI.package/IceLocationModel.class/instance/choose.st index ac3da89298..1ab857f20e 100644 --- a/Iceberg-UI.package/IceLocationModel.class/instance/choose.st +++ b/Iceberg-UI.package/IceLocationModel.class/instance/choose.st @@ -2,4 +2,5 @@ actions choose self chooseReference ifNotNil: [ :reference | self location: reference. - self locationInput text: reference pathString ] \ No newline at end of file + self locationInput text: reference pathString. + self onChoose ifNotNil: #value ] \ No newline at end of file diff --git a/Iceberg-UI.package/IceLocationModel.class/instance/onChoose..st b/Iceberg-UI.package/IceLocationModel.class/instance/onChoose..st new file mode 100644 index 0000000000..899ba6c029 --- /dev/null +++ b/Iceberg-UI.package/IceLocationModel.class/instance/onChoose..st @@ -0,0 +1,5 @@ +hook +onChoose: aBlockClosure + "I allow to set a hook to execute when the user select a location." + + chooseBlock := aBlockClosure \ No newline at end of file diff --git a/Iceberg-UI.package/IceLocationModel.class/instance/onChoose.st b/Iceberg-UI.package/IceLocationModel.class/instance/onChoose.st new file mode 100644 index 0000000000..42e6642d68 --- /dev/null +++ b/Iceberg-UI.package/IceLocationModel.class/instance/onChoose.st @@ -0,0 +1,3 @@ +hook +onChoose + ^ chooseBlock \ No newline at end of file diff --git a/Iceberg-UI.package/IceLocationModel.class/properties.json b/Iceberg-UI.package/IceLocationModel.class/properties.json index 3393a7ed5a..959509d5bb 100644 --- a/Iceberg-UI.package/IceLocationModel.class/properties.json +++ b/Iceberg-UI.package/IceLocationModel.class/properties.json @@ -10,7 +10,8 @@ "locationInput", "chooseButton", "label", - "chooseTitle" + "chooseTitle", + "chooseBlock" ], "name" : "IceLocationModel", "type" : "normal" diff --git a/Iceberg-UI.package/IceRepositoriesBrowser.class/instance/composeRepositories.in..st b/Iceberg-UI.package/IceRepositoriesBrowser.class/instance/composeRepositories.in..st index dda14cdb85..4c8358edd0 100644 --- a/Iceberg-UI.package/IceRepositoriesBrowser.class/instance/composeRepositories.in..st +++ b/Iceberg-UI.package/IceRepositoriesBrowser.class/instance/composeRepositories.in..st @@ -17,7 +17,7 @@ composeRepositories: repositories in: composite table updateOn: MCPackageModified from: MCPackageManager announcer. Iceberg announcer weak - subscribe: IceRepositoryCreated + when: IceRepositoryCreated send: #execute: to: (IceRepositoryUpdateHelper for: table). diff --git a/Iceberg-UI.package/IceRepositoriesBrowser.class/instance/composeRepositoriesIn..st b/Iceberg-UI.package/IceRepositoriesBrowser.class/instance/composeRepositoriesIn..st index d8c19b11e6..b15aaac39d 100644 --- a/Iceberg-UI.package/IceRepositoriesBrowser.class/instance/composeRepositoriesIn..st +++ b/Iceberg-UI.package/IceRepositoriesBrowser.class/instance/composeRepositoriesIn..st @@ -17,7 +17,7 @@ composeRepositoriesIn: composite table updateOn: MCPackageModified from: MCPackageManager announcer. Iceberg announcer weak - subscribe: IceRepositoryCreated + when: IceRepositoryCreated send: #execute: to: (IceRepositoryUpdateHelper for: table). diff --git a/Iceberg-UI.package/IceRepositoryModel.class/instance/restore.st b/Iceberg-UI.package/IceRepositoryModel.class/instance/restore.st index 201a255e50..da5f15f28b 100644 --- a/Iceberg-UI.package/IceRepositoryModel.class/instance/restore.st +++ b/Iceberg-UI.package/IceRepositoryModel.class/instance/restore.st @@ -1,4 +1,3 @@ actions restore - self repository backend cloneRepository. - self repository refresh. + (IceRestoreRepositoryModel repository: self repository) openWithSpec \ No newline at end of file diff --git a/Iceberg-UI.package/IceRestoreRepositoryModel.class/README.md b/Iceberg-UI.package/IceRestoreRepositoryModel.class/README.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Iceberg-UI.package/IceRestoreRepositoryModel.class/class/new.st b/Iceberg-UI.package/IceRestoreRepositoryModel.class/class/new.st new file mode 100644 index 0000000000..fff5b20bea --- /dev/null +++ b/Iceberg-UI.package/IceRestoreRepositoryModel.class/class/new.st @@ -0,0 +1,3 @@ +instance creation +new + self error: 'Use #repository:' \ No newline at end of file diff --git a/Iceberg-UI.package/IceRestoreRepositoryModel.class/class/repository..st b/Iceberg-UI.package/IceRestoreRepositoryModel.class/class/repository..st new file mode 100644 index 0000000000..de3faa4f40 --- /dev/null +++ b/Iceberg-UI.package/IceRestoreRepositoryModel.class/class/repository..st @@ -0,0 +1,5 @@ +instance creation +repository: aRepository + ^ self basicNew + initializeRepository: aRepository; + yourself \ No newline at end of file diff --git a/Iceberg-UI.package/IceRestoreRepositoryModel.class/instance/configureRepository..st b/Iceberg-UI.package/IceRestoreRepositoryModel.class/instance/configureRepository..st new file mode 100644 index 0000000000..1f17ee850a --- /dev/null +++ b/Iceberg-UI.package/IceRestoreRepositoryModel.class/instance/configureRepository..st @@ -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 ] diff --git a/Iceberg-UI.package/IceRestoreRepositoryModel.class/instance/initializeRepository..st b/Iceberg-UI.package/IceRestoreRepositoryModel.class/instance/initializeRepository..st new file mode 100644 index 0000000000..d7245e5f1d --- /dev/null +++ b/Iceberg-UI.package/IceRestoreRepositoryModel.class/instance/initializeRepository..st @@ -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 diff --git a/Iceberg-UI.package/IceRestoreRepositoryModel.class/properties.json b/Iceberg-UI.package/IceRestoreRepositoryModel.class/properties.json new file mode 100644 index 0000000000..b51d3cbcc1 --- /dev/null +++ b/Iceberg-UI.package/IceRestoreRepositoryModel.class/properties.json @@ -0,0 +1,13 @@ +{ + "commentStamp" : "", + "super" : "IceCloneRepositoryModel", + "category" : "Iceberg-UI-View", + "classinstvars" : [ ], + "pools" : [ ], + "classvars" : [ ], + "instvars" : [ + "repository" + ], + "name" : "IceRestoreRepositoryModel", + "type" : "normal" +} \ No newline at end of file diff --git a/Iceberg.package/IceDiff.class/instance/repository..st b/Iceberg.package/IceDiff.class/instance/repository..st index 207142e4d9..131eb379eb 100644 --- a/Iceberg.package/IceDiff.class/instance/repository..st +++ b/Iceberg.package/IceDiff.class/instance/repository..st @@ -2,4 +2,4 @@ accessing repository: anObject repository := anObject. repository announcer weak - subscribe: IceCommited send: #refresh to: self \ No newline at end of file + when: IceCommited send: #refresh to: self \ No newline at end of file diff --git a/Iceberg.package/monticello.meta/categories.st b/Iceberg.package/monticello.meta/categories.st index 3b474247c7..9f5ac70d97 100644 --- a/Iceberg.package/monticello.meta/categories.st +++ b/Iceberg.package/monticello.meta/categories.st @@ -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'!